aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/PrintPreprocessedOutput.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-11 20:10:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-11 20:10:12 +0000
commitd839e77b12313c0150b11835c9302b24fc70b95a (patch)
tree9fb01a8605b52b2d156b529a1f6f78c4ddee4fdd /clang/lib/Frontend/PrintPreprocessedOutput.cpp
parentafe54f1625f57ab65a8446d582621a167eec5c9a (diff)
downloadllvm-d839e77b12313c0150b11835c9302b24fc70b95a.zip
llvm-d839e77b12313c0150b11835c9302b24fc70b95a.tar.gz
llvm-d839e77b12313c0150b11835c9302b24fc70b95a.tar.bz2
Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.
llvm-svn: 105830
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index b6c18b7..e89c425 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -454,6 +454,9 @@ static int MacroIDCompare(const void* a, const void* b) {
}
static void DoPrintMacros(Preprocessor &PP, llvm::raw_ostream *OS) {
+ // Ignore unknown pragmas.
+ PP.AddPragmaHandler(0, new EmptyPragmaHandler());
+
// -dM mode just scans and ignores all tokens in the files, then dumps out
// the macro table at the end.
PP.EnterMainSourceFile();