push some source location information down through the compiler,
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101939 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index eb86645..417724b 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -1098,9 +1098,8 @@
// Ask HeaderInfo if we should enter this #include file. If not, #including
// this file will have no effect.
if (!HeaderInfo.ShouldEnterIncludeFile(File, isImport)) {
- if (Callbacks) {
+ if (Callbacks)
Callbacks->FileSkipped(*File, FilenameTok, FileCharacter);
- }
return;
}
@@ -1113,10 +1112,7 @@
}
// Finally, if all is good, enter the new file!
- std::string ErrorStr;
- if (EnterSourceFile(FID, CurDir, ErrorStr))
- Diag(FilenameTok, diag::err_pp_error_opening_file)
- << std::string(SourceMgr.getFileEntryForID(FID)->getName()) << ErrorStr;
+ EnterSourceFile(FID, CurDir, FilenameTok.getLocation());
}
/// HandleIncludeNextDirective - Implements #include_next.