From: John McCall Date: Fri, 9 Apr 2010 21:48:08 +0000 (+0000) Subject: Provide manglings for bool and character literal expressions. These are X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de81063acdc999fbe1225f466ead12f7e9107acf;p=clang Provide manglings for bool and character literal expressions. These are just integer-literal expressions with special case implementations in the AST. Fixes rdar://problem/7825453. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100905 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index a29841d02b..649e848c99 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -1488,6 +1488,19 @@ void CXXNameMangler::mangleExpression(const Expr *E) { break; } + case Expr::CharacterLiteralClass: + Out << "L"; + mangleType(E->getType()); + Out << cast(E)->getValue(); + Out << 'E'; + break; + + case Expr::CXXBoolLiteralExprClass: + Out << "Lb"; + Out << (cast(E)->getValue() ? '1' : '0'); + Out << 'E'; + break; + case Expr::IntegerLiteralClass: mangleIntegerLiteral(E->getType(), llvm::APSInt(cast(E)->getValue())); diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index ad57c199c4..8f3d356848 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -468,3 +468,12 @@ namespace test9 { f( 0); } } + +// +namespace test10 { + template struct S {}; + template void f(struct S ) {} + + // CHECK: define weak_odr void @_ZN6test101fILc3EEEvNS_1SIXquLb0ELc97ET_EEE( + template void f<(char) 3>(struct S<3>); +}