[cfe-commits] r122820 - /cfe/trunk/lib/CodeGen/Mangle.cpp
Douglas Gregor
dgregor at apple.com
Tue Jan 4 10:56:13 PST 2011
Author: dgregor
Date: Tue Jan 4 12:56:13 2011
New Revision: 122820
URL: http://llvm.org/viewvc/llvm-project?rev=122820&view=rev
Log:
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.
Modified:
cfe/trunk/lib/CodeGen/Mangle.cpp
Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=122820&r1=122819&r2=122820&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Tue Jan 4 12:56:13 2011
@@ -2048,6 +2048,28 @@
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;
+ }
+ }
}
}
More information about the cfe-commits
mailing list