summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-19 18:39:18 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-19 18:39:18 +0000
commita72a4e3229e2f241140d27373c1327f182b54054 (patch)
tree6fa73ca9edcfd126a0ab45c764fb46471d28ac50 /clang/lib/AST/Decl.cpp
parent84d2bd759f60ba8ee1255d0edfbf1aa292a19e70 (diff)
downloadbcm5719-llvm-a72a4e3229e2f241140d27373c1327f182b54054.tar.gz
bcm5719-llvm-a72a4e3229e2f241140d27373c1327f182b54054.zip
Cache the linkage of a type within its canonical type, eliminating
some seriously non-linear performance with deeply nested template instantiations, as shown in PR6998. llvm-svn: 104139
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 535bd341794..c813a47f6b4 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1469,6 +1469,12 @@ TagDecl* TagDecl::getCanonicalDecl() {
return getFirstDeclaration();
}
+void TagDecl::setTypedefForAnonDecl(TypedefDecl *TDD) {
+ TypedefDeclOrQualifier = TDD;
+ if (TypeForDecl)
+ TypeForDecl->ClearLinkageCache();
+}
+
void TagDecl::startDefinition() {
if (TagType *TagT = const_cast<TagType *>(TypeForDecl->getAs<TagType>())) {
TagT->decl.setPointer(this);
OpenPOWER on IntegriCloud