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.

llvm-svn: 100905
This commit is contained in:
John McCall 2010-04-09 21:48:08 +00:00
parent 67dd3a4464
commit 09277542f2
2 changed files with 22 additions and 0 deletions

View File

@ -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()));

View File

@ -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>);
}