diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-12-04 11:12:26 +0000 | 
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-12-04 11:12:26 +0000 | 
| commit | ddc867985ae0f1dd6184abb43906a29e7612229f (patch) | |
| tree | 7d823d42fea2cdc2aa9b1a9d244c00538c1e628b /clang/lib | |
| parent | 5b66bad259944d8b51add03539071dba39d5694f (diff) | |
| download | bcm5719-llvm-ddc867985ae0f1dd6184abb43906a29e7612229f.tar.gz bcm5719-llvm-ddc867985ae0f1dd6184abb43906a29e7612229f.zip  | |
Revert r196372, "do not warn about unknown pragmas in modes that do not handle them (pr9537)"
It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes.
llvm-svn: 196376
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Lex/Pragma.cpp | 11 | ||||
| -rw-r--r-- | clang/lib/Rewrite/Frontend/InclusionRewriter.cpp | 8 | 
4 files changed, 9 insertions, 14 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 88044f2c9a6..a3ab1be4a97 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -485,7 +485,7 @@ void PreprocessOnlyAction::ExecuteAction() {    Preprocessor &PP = getCompilerInstance().getPreprocessor();    // Ignore unknown pragmas. -  PP.IgnorePragmas(); +  PP.AddPragmaHandler(new EmptyPragmaHandler());    Token Tok;    // Start parsing the specified input file. diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 87fbd04041f..f3393bfe51c 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -704,7 +704,7 @@ static int MacroIDCompare(const id_macro_pair *LHS, const id_macro_pair *RHS) {  static void DoPrintMacros(Preprocessor &PP, raw_ostream *OS) {    // Ignore unknown pragmas. -  PP.IgnorePragmas(); +  PP.AddPragmaHandler(new EmptyPragmaHandler());    // -dM mode just scans and ignores all tokens in the files, then dumps out    // the macro table at the end. diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 61bd9172b43..e4059eeb6fc 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -1401,14 +1401,3 @@ void Preprocessor::RegisterBuiltinPragmas() {      AddPragmaHandler(new PragmaRegionHandler("endregion"));    }  } - -/// Ignore all pragmas, useful for modes such as -Eonly which would otherwise -/// warn about those pragmas being unknown. -void Preprocessor::IgnorePragmas() { -  AddPragmaHandler(new EmptyPragmaHandler()); -  // Also ignore all pragmas in all namespaces created -  // in Preprocessor::RegisterBuiltinPragmas(). -  AddPragmaHandler("GCC", new EmptyPragmaHandler()); -  AddPragmaHandler("clang", new EmptyPragmaHandler()); -  AddPragmaHandler("STDC", new EmptyPragmaHandler()); -} diff --git a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp index a3b6c49ac11..176ea3f79dc 100644 --- a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp @@ -518,7 +518,13 @@ void clang::RewriteIncludesInInput(Preprocessor &PP, raw_ostream *OS,    InclusionRewriter *Rewrite = new InclusionRewriter(PP, *OS,                                                       Opts.ShowLineMarkers);    PP.addPPCallbacks(Rewrite); -  PP.IgnorePragmas(); +  // Ignore all pragmas, otherwise there will be warnings about unknown pragmas +  // (because there's nothing to handle them). +  PP.AddPragmaHandler(new EmptyPragmaHandler()); +  // Ignore also all pragma in all namespaces created +  // in Preprocessor::RegisterBuiltinPragmas(). +  PP.AddPragmaHandler("GCC", new EmptyPragmaHandler()); +  PP.AddPragmaHandler("clang", new EmptyPragmaHandler());    // First let the preprocessor process the entire file and call callbacks.    // Callbacks will record which #include's were actually performed.  | 

