aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-04 18:56:13 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-04 18:56:13 +0000
commit2e774c4efb24403049f9235c6ce08506cbb8c82a (patch)
tree96ab144baac92ba0192d1c0ee31d52db4f5306cb /lib/CodeGen/Mangle.cpp
parentf901a7de97f46ba2b1ff153f9fb83d00dc37cfcf (diff)
Implement name mangling for sizeof...(pack), to silence the last of
the switch-enum warnings. Test is forthcoming, once I've dealt with some template argument deduction issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 834ef4e569..0969b8716f 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -2048,6 +2048,28 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
Out << "sp";
mangleExpression(cast<PackExpansionExpr>(E)->getPattern());
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))
+ mangleTemplateParameter(TTP->getIndex());
+ else if (const NonTypeTemplateParmDecl *NTTP
+ = dyn_cast<NonTypeTemplateParmDecl>(Pack))
+ mangleTemplateParameter(NTTP->getIndex());
+ else if (const TemplateTemplateParmDecl *TempTP
+ = dyn_cast<TemplateTemplateParmDecl>(Pack))
+ mangleTemplateParameter(TempTP->getIndex());
+ else {
+ // FIXME: This case isn't handled by the Itanium C++ ABI
+ Diagnostic &Diags = Context.getDiags();
+ unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error,
+ "cannot mangle sizeof...(function parameter pack)");
+ Diags.Report(DiagID);
+ return;
+ }
+ }
}
}