diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-12 18:09:38 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-12 18:09:38 +0000 |
commit | 14c32e8894923eb18d78b461c83b03d70bfd18ac (patch) | |
tree | 5a8513b8ef4e84f8b9dff391a10a61582376a443 /clang/lib/Serialization/ASTReader.cpp | |
parent | 3405baa3f049fcc07a5f3134289b0ce946166f46 (diff) | |
download | bcm5719-llvm-14c32e8894923eb18d78b461c83b03d70bfd18ac.tar.gz bcm5719-llvm-14c32e8894923eb18d78b461c83b03d70bfd18ac.zip |
[libclang] In ASTUnit::Parse copy the CompilerInvocation object instead of
modifying directly for the preamble.
This avoids an awful, hard to find, bug where "PreprocessorOpts.DisablePCHValidation = true"
would be persistent for subsequent reparses of the translation unit which would result
in defines, present in command-line but not in the PCH, being ignored.
Fixes rdar://9615399.
llvm-svn: 139512
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 03efd5bc645..09aee487234 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2595,7 +2595,11 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, // Here comes stuff that we only do once the entire chain is loaded. // Check the predefines buffers. - if (!DisableValidation && Type != MK_Module && CheckPredefinesBuffers()) + if (!DisableValidation && Type != MK_Module && Type != MK_Preamble && + // FIXME: CheckPredefinesBuffers also sets the SuggestedPredefines; + // if DisableValidation is true, defines that were set on command-line + // but not in the PCH file will not be added to SuggestedPredefines. + CheckPredefinesBuffers()) return IgnorePCH; // Initialization of keywords and pragmas occurs before the |