diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-20 20:35:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-20 20:35:58 +0000 |
commit | e127a0d80155b45dafe77f2b4380e5fa111a3345 (patch) | |
tree | b6b2e97ea34265d06945d0365c76eead56356910 /lib/Frontend/CacheTokens.cpp | |
parent | b00ab27f64abd18a68fc41699b86d0bc36189e21 (diff) |
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
Diffstat (limited to 'lib/Frontend/CacheTokens.cpp')
-rw-r--r-- | lib/Frontend/CacheTokens.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp index d069e8f42f..a5fcebe994 100644 --- a/lib/Frontend/CacheTokens.cpp +++ b/lib/Frontend/CacheTokens.cpp @@ -475,7 +475,7 @@ void PTHWriter::GeneratePTH(const std::string &MainFile) { if (!P.isAbsolute()) continue; - const llvm::MemoryBuffer *B = C.getBuffer(PP.getDiagnostics()); + const llvm::MemoryBuffer *B = C.getBuffer(PP.getDiagnostics(), SM); if (!B) continue; FileID FID = SM.createFileID(FE, SourceLocation(), SrcMgr::C_User); @@ -550,8 +550,7 @@ void clang::CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS) { // Lex through the entire file. This will populate SourceManager with // all of the header information. Token Tok; - if (PP.EnterMainSourceFile()) - return; + PP.EnterMainSourceFile(); do { PP.Lex(Tok); } while (Tok.isNot(tok::eof)); // Generate the PTH file. |