forked from OSchip/llvm-project
Don't attempt to merge a deserialized declaration with existing
declarations in the AST unless modules are enabled. This case doesn't come up with precompiled headers, and it isn't cheap. llvm-svn: 147451
This commit is contained in:
parent
2c46b5bd07
commit
e097d4ba26
|
@ -1512,6 +1512,10 @@ ASTDeclReader::VisitRedeclarable(Redeclarable<T> *D) {
|
|||
template<typename T>
|
||||
void ASTDeclReader::mergeRedeclarable(Redeclarable<T> *D,
|
||||
RedeclarableResult &Redecl) {
|
||||
// If modules are not available, there is no reason to perform this merge.
|
||||
if (!Reader.getContext().getLangOptions().Modules)
|
||||
return;
|
||||
|
||||
if (FindExistingResult ExistingRes = findExisting(static_cast<T*>(D))) {
|
||||
if (T *Existing = ExistingRes) {
|
||||
T *ExistingCanon = Existing->getCanonicalDecl();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -fmodule-cache-path %t -I %S/Inputs %s -verify
|
||||
// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -I %S/Inputs %s -verify
|
||||
// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -I %S/Inputs %s -verify
|
||||
// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs %s -verify
|
||||
@class C2;
|
||||
@class C3;
|
||||
@class C3;
|
||||
|
|
Loading…
Reference in New Issue