Fix computation of predefines buffer from the preprocessor-option

checking, and disable the old predefines-buffer-diff'ing code path.

llvm-svn: 166653
This commit is contained in:
Douglas Gregor 2012-10-25 00:25:27 +00:00
parent 840f12cf6b
commit 471c1174c2
1 changed files with 1 additions and 10 deletions

View File

@ -277,6 +277,7 @@ static bool checkPreprocessorOptions(const PreprocessorOptions &PPOpts,
} else { } else {
SuggestedPredefines += "#define "; SuggestedPredefines += "#define ";
SuggestedPredefines += MacroName.str(); SuggestedPredefines += MacroName.str();
SuggestedPredefines += ' ';
SuggestedPredefines += Existing.first.str(); SuggestedPredefines += Existing.first.str();
SuggestedPredefines += '\n'; SuggestedPredefines += '\n';
} }
@ -1026,16 +1027,6 @@ void ASTReader::Error(unsigned DiagID,
/// \brief Tell the AST listener about the predefines buffers in the chain. /// \brief Tell the AST listener about the predefines buffers in the chain.
bool ASTReader::CheckPredefinesBuffers(bool Complain) { bool ASTReader::CheckPredefinesBuffers(bool Complain) {
if (Listener) {
// We only care about the primary module.
ModuleFile &M = ModuleMgr.getPrimaryModule();
SuggestedPredefines.clear();
return Listener->ReadPredefinesBuffer(PCHPredefinesBuffers,
M.ActualOriginalSourceFileName,
SuggestedPredefines,
FileMgr,
Complain);
}
return false; return false;
} }