From d839e77b12313c0150b11835c9302b24fc70b95a Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 11 Jun 2010 20:10:12 +0000 Subject: Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes. llvm-svn: 105830 --- clang/lib/Frontend/PrintPreprocessedOutput.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp') 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(); -- cgit v1.1