summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/MultiplexConsumer.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-03-26 04:09:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-03-26 04:09:53 +0000
commit65ebb4ac8a7119a16e5a00b075e5b382fd4e434c (patch)
treeaba5d66b22388b22c9c2f62df8fd03f0ecacfcb1 /clang/lib/Frontend/MultiplexConsumer.cpp
parente972c3622113feaeaf4c1a7c8a60d193c385cb06 (diff)
downloadbcm5719-llvm-65ebb4ac8a7119a16e5a00b075e5b382fd4e434c.tar.gz
bcm5719-llvm-65ebb4ac8a7119a16e5a00b075e5b382fd4e434c.zip
[modules] If we reach a definition of a class for which we already have a
non-visible definition, skip the new definition and make the old one visible instead of trying to parse it again and failing horribly. C++'s ODR allows us to assume that the two definitions are identical. llvm-svn: 233250
Diffstat (limited to 'clang/lib/Frontend/MultiplexConsumer.cpp')
-rw-r--r--clang/lib/Frontend/MultiplexConsumer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp
index 0d69f570be5..007ddc21f57 100644
--- a/clang/lib/Frontend/MultiplexConsumer.cpp
+++ b/clang/lib/Frontend/MultiplexConsumer.cpp
@@ -110,6 +110,8 @@ public:
const ObjCCategoryDecl *ClassExt) override;
void DeclarationMarkedUsed(const Decl *D) override;
void DeclarationMarkedOpenMPThreadPrivate(const Decl *D) override;
+ void RedefinedHiddenDefinition(const NamedDecl *D,
+ SourceLocation Loc) override;
private:
std::vector<ASTMutationListener*> Listeners;
@@ -193,6 +195,11 @@ void MultiplexASTMutationListener::DeclarationMarkedOpenMPThreadPrivate(
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
Listeners[i]->DeclarationMarkedOpenMPThreadPrivate(D);
}
+void MultiplexASTMutationListener::RedefinedHiddenDefinition(
+ const NamedDecl *D, SourceLocation Loc) {
+ for (auto *L : Listeners)
+ L->RedefinedHiddenDefinition(D, Loc);
+}
} // end namespace clang
OpenPOWER on IntegriCloud