aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-13 16:39:34 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-13 16:39:34 +0000
commit4fc4866945de9b0f1f77a17557060f0ff959b0b1 (patch)
tree2010b7f1372a2a8a4fa895e13692cfd653966490 /lib/CodeGen/Mangle.cpp
parente17da65c5773e0285b22e33d1431b13fbcd8942c (diff)
Add tests for name mangling of variadic templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index ff0e9223c8..0dfa0520af 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -1476,7 +1476,7 @@ void CXXNameMangler::mangleType(const DependentSizedExtVectorType *T) {
}
void CXXNameMangler::mangleType(const PackExpansionType *T) {
- // FIXME: We may need to push this mangling into the callers
+ // <type> ::= Dp <type> # pack expansion (C++0x)
Out << "sp";
mangleType(T->getPattern());
}
@@ -1626,6 +1626,7 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
// ::= sr <type> <unqualified-name> # dependent name
// ::= sr <type> <unqualified-name> <template-args> # dependent template-id
// ::= sZ <template-param> # size of a parameter pack
+ // ::= sZ <function-param> # size of a function parameter pack
// ::= <expr-primary>
// <expr-primary> ::= L <type> <value number> E # integer literal
// ::= L <type <value float> E # floating literal
@@ -2050,7 +2051,6 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
break;
case Expr::SizeOfPackExprClass: {
- // FIXME: Variadic templates missing mangling for function parameter packs?
Out << "sZ";
const NamedDecl *Pack = cast<SizeOfPackExpr>(E)->getPack();
if (const TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(Pack))
@@ -2062,7 +2062,8 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
= dyn_cast<TemplateTemplateParmDecl>(Pack))
mangleTemplateParameter(TempTP->getIndex());
else {
- // FIXME: This case isn't handled by the Itanium C++ ABI
+ // Note: proposed by Mike Herrick on 11/30/10
+ // <expression> ::= sZ <function-param> # size of function parameter pack
Diagnostic &Diags = Context.getDiags();
unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error,
"cannot mangle sizeof...(function parameter pack)");
@@ -2156,7 +2157,7 @@ void CXXNameMangler::mangleTemplateArg(const NamedDecl *P,
// <template-arg> ::= <type> # type or template
// ::= X <expression> E # expression
// ::= <expr-primary> # simple expressions
- // ::= I <template-arg>* E # argument pack
+ // ::= J <template-arg>* E # argument pack
// ::= sp <expression> # pack expansion of (C++0x)
switch (A.getKind()) {
case TemplateArgument::Null:
@@ -2170,7 +2171,7 @@ void CXXNameMangler::mangleTemplateArg(const NamedDecl *P,
mangleType(A.getAsTemplate());
break;
case TemplateArgument::TemplateExpansion:
- // This is mangled as Dp <type>.
+ // <type> ::= Dp <type> # pack expansion (C++0x)
Out << "Dp";
mangleType(A.getAsTemplateOrTemplatePattern());
break;