diff options
author | John McCall <rjmccall@apple.com> | 2010-04-09 21:48:08 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-09 21:48:08 +0000 |
commit | de81063acdc999fbe1225f466ead12f7e9107acf (patch) | |
tree | 5eef86c3ffdfa3fd673f89d1d2fdf609332a670b | |
parent | 78713d86faeaaabb8aeb1683353e791defd3a3bf (diff) |
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
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 13 | ||||
-rw-r--r-- | test/CodeGenCXX/mangle.cpp | 9 |
2 files changed, 22 insertions, 0 deletions
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<CharacterLiteral>(E)->getValue(); + Out << 'E'; + break; + + case Expr::CXXBoolLiteralExprClass: + Out << "Lb"; + Out << (cast<CXXBoolLiteralExpr>(E)->getValue() ? '1' : '0'); + Out << 'E'; + break; + case Expr::IntegerLiteralClass: mangleIntegerLiteral(E->getType(), llvm::APSInt(cast<IntegerLiteral>(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<int, bar>( 0); } } + +// <rdar://problem/7825453> +namespace test10 { + template <char P1> struct S {}; + template <char P2> void f(struct S<false ? 'a' : P2> ) {} + + // CHECK: define weak_odr void @_ZN6test101fILc3EEEvNS_1SIXquLb0ELc97ET_EEE( + template void f<(char) 3>(struct S<3>); +} |