[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-09 Thread Nico Weber via Phabricator via cfe-commits
thakis closed this revision. thakis added a comment. r289228, thanks! https://reviews.llvm.org/D27545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-09 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. lgtm https://reviews.llvm.org/D27545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-09 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. (The reason that the predefines buffer doesn't override the value of `__STDC_HOSTED__` from the pch is that CompilerInstance::createPCHExternalASTSource overrides the predefines buffer with a different predefines buffer suggested by the ASTReader, usually an empty one.)

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-09 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 80849. thakis added a comment. update a comment https://reviews.llvm.org/D27545 Files: include/clang/Lex/Preprocessor.h lib/Lex/PPMacroExpansion.cpp lib/Serialization/ASTReader.cpp test/PCH/builtin-macro.c Index: test/PCH/builtin-macro.c ===

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-09 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: lib/Lex/PPMacroExpansion.cpp:110-112 +// FIXME: shouldIgnoreMacro() in ASTWriter also stops at macros from the +// predefines buffer in module builds. Do we need to splice to those here +// too? rsmith wrote:

Re: [PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-08 Thread Nico Weber via cfe-commits
(I replied to comments about 1h ago, looks like phab is not in the mood for sending a mail for that for some reason. I did use the "Leap into action" submit button.) On Wed, Dec 7, 2016 at 9:19 PM, Richard Smith via Phabricator < revi...@reviews.llvm.org> wrote: > rsmith added inline comments. >

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-07 Thread Richard Smith via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Lex/PPMacroExpansion.cpp:110-112 +// FIXME: shouldIgnoreMacro() in ASTWriter also stops at macros from the +// predefines buffer in module builds. Do we need to splice to those here +// too? If I remember

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-07 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. Thanks! Comment at: test/PCH/builtin-macro.c:29 + +const char s[] = __DATE__ " " __TIME__ " " __TIMESTAMP__; + rnk wrote: > This test doesn't seem to fail if `__DATE__` expands to something. I removed > `-D__DATE__=` from the command li

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-07 Thread Nico Weber via Phabricator via cfe-commits
thakis updated this revision to Diff 80687. thakis marked 2 inline comments as done. thakis added a comment. comments https://reviews.llvm.org/D27545 Files: include/clang/Lex/Preprocessor.h lib/Lex/PPMacroExpansion.cpp lib/Serialization/ASTReader.cpp test/PCH/builtin-macro.c Index: tes

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-07 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. Fix seems reasonable. Comment at: lib/Lex/PPMacroExpansion.cpp:115 + "only built-ins should have an entry here"); +assert(!OldMD->getPrevious() && "builtin should only have a singe entry"); +ED->setPrevious(OldMD); "single

[PATCH] D27545: Don't assert when redefining a built-in macro in a PCH, PR29119

2016-12-07 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision. thakis added a reviewer: rnk. thakis added subscribers: cfe-commits, rsmith. 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 co