aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-03 17:31:38 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-03 17:31:38 +0000
commit674949fe3fdd796fc643f0e7660cb973da1dd383 (patch)
treead4103da03461279bbb762aa6277d2166072798e /lib/Serialization/ASTReaderDecl.cpp
parentdea22cc576c8b3d27b96f5727aa8fd313f18199e (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index abab88a9c6..82f6fae4a0 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -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();