aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-05 20:45:00 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-05 20:45:00 +0000
commit32fb4e1fd1cbd2ff006cc0e06c997e4eea2f0e28 (patch)
treeb376d08038c7b791de556cdad29a828ec4af6fcb /lib/CodeGen/Mangle.cpp
parente01ca51f4167b5a7fd1d6230f2e2f1f177fd68e3 (diff)
Implement name mangling for template template parameters
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index cb304960ce..3f541ae87a 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -400,6 +400,13 @@ void CXXNameMangler::mangleUnscopedTemplateName(const TemplateDecl *ND) {
if (mangleSubstitution(ND))
return;
+ // <template-template-param> ::= <template-param>
+ if (const TemplateTemplateParmDecl *TTP
+ = dyn_cast<TemplateTemplateParmDecl>(ND)) {
+ mangleTemplateParameter(TTP->getIndex());
+ return;
+ }
+
mangleUnscopedName(ND->getTemplatedDecl());
addSubstitution(ND);
}
@@ -674,15 +681,21 @@ void CXXNameMangler::mangleTemplatePrefix(const TemplateDecl *ND) {
// <template-prefix> ::= <prefix> <template unqualified-name>
// ::= <template-param>
// ::= <substitution>
+ // <template-template-param> ::= <template-param>
+ // <substitution>
if (mangleSubstitution(ND))
return;
- // FIXME: <template-param>
+ // <template-template-param> ::= <template-param>
+ if (const TemplateTemplateParmDecl *TTP
+ = dyn_cast<TemplateTemplateParmDecl>(ND)) {
+ mangleTemplateParameter(TTP->getIndex());
+ return;
+ }
manglePrefix(ND->getDeclContext());
mangleUnqualifiedName(ND->getTemplatedDecl());
-
addSubstitution(ND);
}