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 | fb24a3a4ec3d625981bb822e021dc89a0cf3fde1 (patch) | |
tree | 20d53042ca9baae6abb062b22670a5305f79fc27 /clang/lib/Frontend/CacheTokens.cpp | |
parent | 877aaa9706e8bed893cebfc292a2ca305ec30663 (diff) | |
download | llvm-fb24a3a4ec3d625981bb822e021dc89a0cf3fde1.zip llvm-fb24a3a4ec3d625981bb822e021dc89a0cf3fde1.tar.gz llvm-fb24a3a4ec3d625981bb822e021dc89a0cf3fde1.tar.bz2 |
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.
llvm-svn: 101939
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r-- | clang/lib/Frontend/CacheTokens.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp index d069e8f42..a5fcebe 100644 --- a/clang/lib/Frontend/CacheTokens.cpp +++ b/clang/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. |