[cfe-commits] r149854 - in /cfe/trunk: lib/AST/ItaniumMangle.cpp test/CodeGenCXX/mangle-exprs.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Sun Feb 5 18:54:51 PST 2012
Author: rsmith
Date: Sun Feb 5 20:54:51 2012
New Revision: 149854
URL: http://llvm.org/viewvc/llvm-project?rev=149854&view=rev
Log:
Implement name mangling for scalar value initialization. Reported on IRC by Xeo.
Modified:
cfe/trunk/lib/AST/ItaniumMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp
Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=149854&r1=149853&r2=149854&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Sun Feb 5 20:54:51 2012
@@ -2247,7 +2247,6 @@
case Expr::ImplicitValueInitExprClass:
case Expr::InitListExprClass:
case Expr::ParenListExprClass:
- case Expr::CXXScalarValueInitExprClass:
llvm_unreachable("unexpected statement kind");
// FIXME: invent manglings for all these.
@@ -2427,6 +2426,12 @@
break;
}
+ case Expr::CXXScalarValueInitExprClass:
+ Out <<"cv";
+ mangleType(E->getType());
+ Out <<"_E";
+ break;
+
case Expr::UnaryExprOrTypeTraitExprClass: {
const UnaryExprOrTypeTraitExpr *SAE = cast<UnaryExprOrTypeTraitExpr>(E);
Modified: cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp?rev=149854&r1=149853&r2=149854&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-exprs.cpp Sun Feb 5 20:54:51 2012
@@ -28,6 +28,10 @@
void auto_(decltype(new auto(T()))) {
}
+ template< typename T >
+ void scalar_(decltype(T(), int())) {
+ }
+
// FIXME: Test const_cast, reinterpret_cast, dynamic_cast, which are
// a bit harder to use in template arguments.
template <unsigned N> struct T {};
@@ -48,6 +52,9 @@
// CHECK: define weak_odr void @_ZN5Casts5auto_IiEEvDTnw_DapicvT__EEE(
template void auto_<int>(int*);
+
+ // CHECK: define weak_odr void @_ZN5Casts7scalar_IiEEvDTcmcvT__Ecvi_EE(
+ template void scalar_<int>(int);
}
namespace test1 {
More information about the cfe-commits
mailing list