From 0fa6df440023a95d8b47c79111e8613fc29f723b Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 26 Sep 2009 19:45:45 +0000 Subject: [PATCH] mangleTemplatePrefix and mangleUnscopedTemplateName should take a TemplateDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82871 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/Mangle.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 629b46bf94..69e73e78c0 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -74,7 +74,7 @@ namespace { unsigned NumTemplateArgs); void mangleUnqualifiedName(const NamedDecl *ND); void mangleUnscopedName(const NamedDecl *ND); - void mangleUnscopedTemplateName(const NamedDecl *ND); + void mangleUnscopedTemplateName(const TemplateDecl *ND); void mangleSourceName(const IdentifierInfo *II); void mangleLocalName(const NamedDecl *ND); void mangleNestedName(const NamedDecl *ND); @@ -82,7 +82,7 @@ namespace { const TemplateArgument *TemplateArgs, unsigned NumTemplateArgs); void manglePrefix(const DeclContext *DC); - void mangleTemplatePrefix(const NamedDecl *ND); + void mangleTemplatePrefix(const TemplateDecl *ND); void mangleOperatorName(OverloadedOperatorKind OO, unsigned Arity); void mangleQualifiers(Qualifiers Quals); void mangleType(QualType T); @@ -285,7 +285,7 @@ void CXXNameMangler::mangleName(const NamedDecl *ND) { if (DC->isTranslationUnit() || isStdNamespace(DC)) { // Check if we have a template. const TemplateArgumentList *TemplateArgs = 0; - if (const NamedDecl *TD = isTemplate(ND, TemplateArgs)) { + if (const TemplateDecl *TD = isTemplate(ND, TemplateArgs)) { mangleUnscopedTemplateName(TD); mangleTemplateArgumentList(*TemplateArgs); return; @@ -313,7 +313,7 @@ void CXXNameMangler::mangleName(const TemplateDecl *TD, } if (DC->isTranslationUnit() || isStdNamespace(DC)) { - mangleUnscopedTemplateName(cast(TD->getTemplatedDecl())); + mangleUnscopedTemplateName(TD); mangleTemplateArgs(TemplateArgs, NumTemplateArgs); } else { mangleNestedName(TD, TemplateArgs, NumTemplateArgs); @@ -329,7 +329,7 @@ void CXXNameMangler::mangleUnscopedName(const NamedDecl *ND) { mangleUnqualifiedName(ND); } -void CXXNameMangler::mangleUnscopedTemplateName(const NamedDecl *ND) { +void CXXNameMangler::mangleUnscopedTemplateName(const TemplateDecl *ND) { // ::= // ::= if (mangleSubstitution(ND)) @@ -463,7 +463,7 @@ void CXXNameMangler::mangleNestedName(const NamedDecl *ND) { // Check if we have a template. const TemplateArgumentList *TemplateArgs = 0; - if (const NamedDecl *TD = isTemplate(ND, TemplateArgs)) { + if (const TemplateDecl *TD = isTemplate(ND, TemplateArgs)) { mangleTemplatePrefix(TD); mangleTemplateArgumentList(*TemplateArgs); } else { @@ -478,7 +478,7 @@ void CXXNameMangler::mangleNestedName(const TemplateDecl *TD, unsigned NumTemplateArgs) { Out << 'N'; manglePrefix(TD->getDeclContext()); - mangleUnqualifiedName(TD->getTemplatedDecl()); + mangleUnqualifiedName(TD); mangleTemplateArgs(TemplateArgs, NumTemplateArgs); Out << 'E'; @@ -513,7 +513,7 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) { // Check if we have a template. const TemplateArgumentList *TemplateArgs = 0; - if (const NamedDecl *TD = isTemplate(cast(DC), TemplateArgs)) { + if (const TemplateDecl *TD = isTemplate(cast(DC), TemplateArgs)) { mangleTemplatePrefix(TD); mangleTemplateArgumentList(*TemplateArgs); } else { @@ -524,7 +524,7 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) { addSubstitution(cast(DC)); } -void CXXNameMangler::mangleTemplatePrefix(const NamedDecl *ND) { +void CXXNameMangler::mangleTemplatePrefix(const TemplateDecl *ND) { // ::=