summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-03 17:39:30 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-03 17:39:30 +0000
commit0c2f30b9d3cd040f943ba444954d0f626ac3f16d (patch)
tree1b8b761ac1ec67289024315f43fd81a9667ca35f /clang/lib/Serialization
parent04e213b6b6fb14b8b20b83bf7fd4a4cddbbcb91c (diff)
downloadbcm5719-llvm-0c2f30b9d3cd040f943ba444954d0f626ac3f16d.tar.gz
bcm5719-llvm-0c2f30b9d3cd040f943ba444954d0f626ac3f16d.zip
[preprocessor] Allow comparing two macro definitions syntactically instead of only lexically.
Syntactically means the function macro parameter names do not need to use the same identifiers in order for the definitions to be considered identical. Syntactic equivalence is a microsoft extension for macro redefinitions and we'll also use this kind of comparison to check for ambiguous macros coming from modules. rdar://13562254 llvm-svn: 178671
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 4c2d2197e49..4c4277c30fd 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -1604,7 +1604,8 @@ void ASTReader::installImportedMacro(IdentifierInfo *II, MacroDirective *MD,
MacroDirective::DefInfo PrevDef = Prev->getDefinition();
MacroInfo *PrevMI = PrevDef.getMacroInfo();
MacroInfo *NewMI = DefMD->getInfo();
- if (NewMI != PrevMI && !PrevMI->isIdenticalTo(*NewMI, PP)) {
+ if (NewMI != PrevMI && !PrevMI->isIdenticalTo(*NewMI, PP,
+ /*Syntactically=*/true)) {
// Before marking the macros as ambiguous, check if this is a case where
// the system macro uses a not identical definition compared to a macro
// from the clang headers. For example:
OpenPOWER on IntegriCloud