declarations in the AST unless modules are enabled. This case doesn't
come up with precompiled headers, and it isn't cheap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147451
91177308-0d34-0410-b5e6-
96231b3b80d8
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();
// 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;