From: Anders Carlsson Date: Fri, 18 Sep 2009 19:44:50 +0000 (+0000) Subject: Make the mangler conform even better to the grammar. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eafc6dcf670070812a99fcc6db21945a786d9829;p=clang Make the mangler conform even better to the grammar. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82262 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 61b42b9056..5df2a34def 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -262,8 +262,13 @@ static const NamedDecl *isTemplate(const NamedDecl *ND, } } - // FIXME: Check if we have a class template. - + // Check if we have a class template. + if (const ClassTemplateSpecializationDecl *Spec = + dyn_cast(ND)) { + TemplateArgs = &Spec->getTemplateArgs(); + return Spec; + } + return 0; } @@ -507,16 +512,7 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) { return; manglePrefix(DC->getParent()); - - if (const NamespaceDecl *Namespace = dyn_cast(DC)) - mangleSourceName(Namespace->getIdentifier()); - else if (const RecordDecl *Record = dyn_cast(DC)) { - if (const ClassTemplateSpecializationDecl *D = - dyn_cast(Record)) { - mangleType(QualType(D->getTypeForDecl(), 0)); - } else - mangleSourceName(Record->getIdentifier()); - } + mangleUnqualifiedName(cast(DC)); addSubstitution(cast(DC)); }