summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-03-10 17:07:44 +0000
committerAnders Carlsson <andersca@mac.com>2009-03-10 17:07:44 +0000
commit0275115f665a440111e62a3dcbae46989b254b4b (patch)
tree0c0730f330f026816cf3998f4b51a0c73a2ace30 /clang/lib/Sema
parent9a9a4228865dade4ffc8440b45e0ec66f58af6f7 (diff)
downloadbcm5719-llvm-0275115f665a440111e62a3dcbae46989b254b4b.tar.gz
bcm5719-llvm-0275115f665a440111e62a3dcbae46989b254b4b.zip
Address Doug's comments wrt the mangler and fix Eli's test case
llvm-svn: 66549
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index fbdab591c3a..049c9394526 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2867,6 +2867,16 @@ TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
D.getIdentifierLoc(),
D.getIdentifier(),
T);
+
+ if (TagType *TT = dyn_cast<TagType>(T)) {
+ TagDecl *TD = TT->getDecl();
+
+ // If the TagDecl that the TypedefDecl points to is an anonymous decl
+ // keep track of the TypedefDecl.
+ if (!TD->getIdentifier() && !TD->getTypedefForAnonDecl())
+ TD->setTypedefForAnonDecl(NewTD);
+ }
+
NewTD->setNextDeclarator(LastDeclarator);
if (D.getInvalidType())
NewTD->setInvalidDecl();
OpenPOWER on IntegriCloud