[PATCH] Mangling of anonymous unions
Evgeny Astigeevich
evgeny.astigeevich at arm.com
Mon Dec 1 05:35:51 PST 2014
Ping
================
Comment at: lib/AST/ItaniumMangle.cpp:3913-3925
@@ +3912,15 @@
+unsigned ItaniumMangleContextImpl::uniquifyNamedDecl(const NamedDecl *ND) {
+ IdentifierInfo *Identifier = ND->getIdentifier();
+ if (!Identifier) {
+ if (const VarDecl *VD = dyn_cast<VarDecl>(ND)) {
+ if (const RecordType *RT = VD->getType()->getAs<RecordType>()) {
+ const RecordDecl *RD = RT->getDecl();
+ if (RD->isUnion()) {
+ if (const FieldDecl *FD = RD->findFirstNamedDataMember()) {
+ Identifier = FD->getIdentifier();
+ }
+ }
+ }
+ }
+ }
+ unsigned &Discriminator = Uniquifier[ND];
----------------
rsmith wrote:
> Why do you need to do this? Since this code is only reached for non-externally-visible entities, a single counter for the context (like we used to use) seems like it should be sufficient.
You are right. Reverted to the old code.
http://reviews.llvm.org/D6295
More information about the cfe-commits
mailing list