The latest draft uses 'dt' to mangle member expressions, and now so do we.

llvm-svn: 97479
This commit is contained in:
John McCall 2010-03-01 19:12:25 +00:00
parent 79e31db9a9
commit de9607bc6f
2 changed files with 4 additions and 10 deletions

View File

@ -1163,20 +1163,14 @@ void CXXNameMangler::mangleCalledExpression(const Expr *E, unsigned Arity) {
/// Mangles a member expression. Implicit accesses are not handled,
/// but that should be okay, because you shouldn't be able to
/// make an implicit access in a function template declaration.
///
/// The standard ABI does not describe how member expressions should
/// be mangled, so this is very unstandardized. We mangle as if it
/// were a binary operator, except that the RHS is mangled as an
/// abstract name.
///
/// The standard ABI also does not assign a mangling to the dot
/// operator, so we arbitrarily select 'me'.
void CXXNameMangler::mangleMemberExpr(const Expr *Base,
bool IsArrow,
NestedNameSpecifier *Qualifier,
DeclarationName Member,
unsigned Arity) {
Out << (IsArrow ? "pt" : "me");
// gcc-4.4 uses 'dt' for dot expressions, which is reasonable.
// OTOH, gcc also mangles the name as an expression.
Out << (IsArrow ? "pt" : "dt");
mangleExpression(Base);
mangleUnresolvedName(Qualifier, Member, Arity);
}

View File

@ -363,7 +363,7 @@ namespace test0 {
char buffer[1024];
j<A>(buffer);
}
// CHECK: define linkonce_odr void @_ZN5test01jINS_1AEEEvRAszmecvT__E6buffer_c(
// CHECK: define linkonce_odr void @_ZN5test01jINS_1AEEEvRAszdtcvT__E6buffer_c(
}
namespace test1 {