diff options
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/Pragma.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index e2a192b01f2..d678ce5d7fb 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -103,6 +103,9 @@ void PragmaNamespace::HandlePragma(Preprocessor &PP, /// HandlePragmaDirective - The "#pragma" directive has been parsed. Lex the /// rest of the pragma, passing it to the registered pragma handlers. void Preprocessor::HandlePragmaDirective(unsigned Introducer) { + if (!PragmasEnabled) + return; + ++NumPragma; // Invoke the first level of pragma handlers which reads the namespace id. diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 4be59c65f77..b420c6cd1d2 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -90,7 +90,8 @@ Preprocessor::Preprocessor(DiagnosticsEngine &diags, LangOptions &opts, InMacroArgs = false; InMacroArgPreExpansion = false; NumCachedTokenLexers = 0; - + PragmasEnabled = true; + CachedLexPos = 0; // We haven't read anything from the external source. |