Index: include/clang/Lex/PPCallbacks.h
===================================================================
--- include/clang/Lex/PPCallbacks.h	(revision 143507)
+++ include/clang/Lex/PPCallbacks.h	(working copy)
@@ -91,6 +91,9 @@
   ///
   /// \param RelativePath The path relative to SearchPath, at which the include
   /// file was found. This is equal to FileName except for framework includes.
+  ///
+  /// \param RecoveryName If File is null the client may recover from the
+  /// failure to find the file by supplying an absolute path in RecoveryName.
   virtual void InclusionDirective(SourceLocation HashLoc,
                                   const Token &IncludeTok,
                                   StringRef FileName,
@@ -98,7 +101,8 @@
                                   const FileEntry *File,
                                   SourceLocation EndLoc,
                                   StringRef SearchPath,
-                                  StringRef RelativePath) {
+                                  StringRef RelativePath,
+                                  SmallVectorImpl<char> &RecoveryName) {
   }
 
   /// EndOfMainFile - This callback is invoked when the end of the main file is
@@ -238,11 +242,12 @@
                                   const FileEntry *File,
                                   SourceLocation EndLoc,
                                   StringRef SearchPath,
-                                  StringRef RelativePath) {
+                                  StringRef RelativePath,
+                                  SmallVectorImpl<char> &RecoveryName) {
     First->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, File,
-                              EndLoc, SearchPath, RelativePath);
+                              EndLoc, SearchPath, RelativePath, RecoveryName);
     Second->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, File,
-                               EndLoc, SearchPath, RelativePath);
+                               EndLoc, SearchPath, RelativePath, RecoveryName);
   }
 
   virtual void EndOfMainFile() {
Index: include/clang/Lex/PreprocessingRecord.h
===================================================================
--- include/clang/Lex/PreprocessingRecord.h	(revision 143507)
+++ include/clang/Lex/PreprocessingRecord.h	(working copy)
@@ -545,7 +545,8 @@
                                     const FileEntry *File,
                                     SourceLocation EndLoc,
                                     StringRef SearchPath,
-                                    StringRef RelativePath);
+                                    StringRef RelativePath,
+                                    SmallVectorImpl<char> &RecoveryName);
 
   private:
     /// \brief Cached result of the last \see getPreprocessedEntitiesInRange
Index: lib/Frontend/DependencyFile.cpp
===================================================================
--- lib/Frontend/DependencyFile.cpp	(revision 143507)
+++ lib/Frontend/DependencyFile.cpp	(working copy)
@@ -61,7 +61,8 @@
                                   const FileEntry *File,
                                   SourceLocation EndLoc,
                                   StringRef SearchPath,
-                                  StringRef RelativePath);
+                                  StringRef RelativePath,
+                                  SmallVectorImpl<char> &RecoveryName);
 
   virtual void EndOfMainFile() {
     OutputDependencyFile();
@@ -144,7 +145,8 @@
                                                 const FileEntry *File,
                                                 SourceLocation EndLoc,
                                                 StringRef SearchPath,
-                                                StringRef RelativePath) {
+                                                StringRef RelativePath,
+                                                SmallVectorImpl<char> &) {
   if (AddMissingHeaderDeps && !File)
     AddFilename(FileName);
 }
Index: lib/Lex/PPDirectives.cpp
===================================================================
--- lib/Lex/PPDirectives.cpp	(revision 143507)
+++ lib/Lex/PPDirectives.cpp	(working copy)
@@ -1285,10 +1285,16 @@
   }
   
   // Notify the callback object that we've seen an inclusion directive.
-  if (Callbacks)
+  if (Callbacks) {
+    llvm::SmallString<128> RecoveryName;
     Callbacks->InclusionDirective(HashLoc, IncludeTok, Filename, isAngled, File,
-                                  End, SearchPath, RelativePath);
+                                  End, SearchPath, RelativePath, RecoveryName);
 
+    if (!File && !RecoveryName.empty()) {
+      File = FileMgr.getFile(RecoveryName, true);
+    }
+  }
+
   if (File == 0) {
     if (!SuppressIncludeNotFoundError)
       Diag(FilenameTok, diag::err_pp_file_not_found) << Filename;
Index: lib/Lex/PreprocessingRecord.cpp
===================================================================
--- lib/Lex/PreprocessingRecord.cpp	(revision 143507)
+++ lib/Lex/PreprocessingRecord.cpp	(working copy)
@@ -368,7 +368,8 @@
     const FileEntry *File,
     clang::SourceLocation EndLoc,
     StringRef SearchPath,
-    StringRef RelativePath) {
+    StringRef RelativePath,
+    SmallVectorImpl<char> &RecoveryName) {
   InclusionDirective::InclusionKind Kind = InclusionDirective::Include;
   
   switch (IncludeTok.getIdentifierInfo()->getPPKeywordID()) {
