зеркало из https://github.com/microsoft/clang-1.git
Loosen r178109 even further, to assume that all redefined macros in system headers and system modules are equivalent.
Fixes <rdar://problem/14025673>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
56b108ad2b
Коммит
f9dbae754b
|
@ -1585,18 +1585,21 @@ void ASTReader::installPCHMacroDirectives(IdentifierInfo *II,
|
|||
/// \brief For the given macro definitions, check if they are both in system
|
||||
/// modules.
|
||||
static bool areDefinedInSystemModules(MacroInfo *PrevMI, MacroInfo *NewMI,
|
||||
Module *NewOwner, ASTReader &Reader) {
|
||||
Module *NewOwner, ASTReader &Reader) {
|
||||
assert(PrevMI && NewMI);
|
||||
if (!NewOwner)
|
||||
return false;
|
||||
Module *PrevOwner = 0;
|
||||
if (SubmoduleID PrevModID = PrevMI->getOwningModuleID())
|
||||
PrevOwner = Reader.getSubmodule(PrevModID);
|
||||
if (!PrevOwner)
|
||||
SourceManager &SrcMgr = Reader.getSourceManager();
|
||||
bool PrevInSystem
|
||||
= PrevOwner? PrevOwner->IsSystem
|
||||
: SrcMgr.isInSystemHeader(PrevMI->getDefinitionLoc());
|
||||
bool NewInSystem
|
||||
= NewOwner? NewOwner->IsSystem
|
||||
: SrcMgr.isInSystemHeader(NewMI->getDefinitionLoc());
|
||||
if (PrevOwner && PrevOwner == NewOwner)
|
||||
return false;
|
||||
if (PrevOwner == NewOwner)
|
||||
return false;
|
||||
return PrevOwner->IsSystem && NewOwner->IsSystem;
|
||||
return PrevInSystem && NewInSystem;
|
||||
}
|
||||
|
||||
void ASTReader::installImportedMacro(IdentifierInfo *II, MacroDirective *MD,
|
||||
|
|
Загрузка…
Ссылка в новой задаче