aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/PrintPreprocessedOutput.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-20 20:35:58 +0000
committerChris Lattner <sabre@nondot.org>2010-04-20 20:35:58 +0000
commitfb24a3a4ec3d625981bb822e021dc89a0cf3fde1 (patch)
tree20d53042ca9baae6abb062b22670a5305f79fc27 /clang/lib/Frontend/PrintPreprocessedOutput.cpp
parent877aaa9706e8bed893cebfc292a2ca305ec30663 (diff)
downloadllvm-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/PrintPreprocessedOutput.cpp')
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 17edd12..b6c18b7 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -456,8 +456,7 @@ static int MacroIDCompare(const void* a, const void* b) {
static void DoPrintMacros(Preprocessor &PP, llvm::raw_ostream *OS) {
// -dM mode just scans and ignores all tokens in the files, then dumps out
// the macro table at the end.
- if (PP.EnterMainSourceFile())
- return;
+ PP.EnterMainSourceFile();
Token Tok;
do PP.Lex(Tok);
@@ -502,8 +501,7 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream *OS,
PP.addPPCallbacks(Callbacks);
// After we have configured the preprocessor, enter the main file.
- if (PP.EnterMainSourceFile())
- return;
+ PP.EnterMainSourceFile();
// Consume all of the tokens that come from the predefines buffer. Those
// should not be emitted into the output and are guaranteed to be at the