summaryrefslogtreecommitdiffstats
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-12-09 17:32:52 +0000
committerNico Weber <nicolasweber@gmx.de>2016-12-09 17:32:52 +0000
commit553c89e72476a0370e696290f8b13fcc78065427 (patch)
tree781bb7efdaab356ddb224faaa3cc7e9c3fe79a42 /include/clang/Lex/Preprocessor.h
parent3a67a19e28fc3380fb836a5ff9a33a55cf197547 (diff)
Don't assert when redefining a built-in macro in a PCH, PR29119
PCH files store the macro history for a given macro, and the whole history list for one identifier is given to the Preprocessor at once via Preprocessor::setLoadedMacroDirective(). This contained an assert that no macro history exists yet for that identifier. That's usually true, but it's not true for builtin macros, which are created in Preprocessor() before flags and pchs are processed. Luckily, ASTWriter stops writing macro history lists at builtins (see shouldIgnoreMacro() in ASTWriter.cpp), so the head of the history list was missing for builtin macros. So make the assert weaker, and splice the history list to the existing single define for builtins. https://reviews.llvm.org/D27545 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index ccef9eebc3..bb71f49290 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -887,7 +887,8 @@ public:
return appendDefMacroDirective(II, MI, MI->getDefinitionLoc());
}
/// \brief Set a MacroDirective that was loaded from a PCH file.
- void setLoadedMacroDirective(IdentifierInfo *II, MacroDirective *MD);
+ void setLoadedMacroDirective(IdentifierInfo *II, MacroDirective *ED,
+ MacroDirective *MD);
/// \brief Register an exported macro for a module and identifier.
ModuleMacro *addModuleMacro(Module *Mod, IdentifierInfo *II, MacroInfo *Macro,