forked from OSchip/llvm-project
Mangle member pointer types in the Microsoft C++ Mangler.
llvm-svn: 107567
This commit is contained in:
parent
dae2a1607e
commit
d49950a317
|
@ -645,7 +645,7 @@ void MicrosoftCXXNameMangler::mangleType(QualType T) {
|
||||||
// ::= Q # const pointer
|
// ::= Q # const pointer
|
||||||
// ::= R # volatile pointer
|
// ::= R # volatile pointer
|
||||||
// ::= S # const volatile pointer
|
// ::= S # const volatile pointer
|
||||||
if (T->isPointerType()) {
|
if (T->isAnyPointerType() || T->isMemberPointerType()) {
|
||||||
if (!Quals.hasVolatile()) {
|
if (!Quals.hasVolatile()) {
|
||||||
Out << 'Q';
|
Out << 'Q';
|
||||||
} else {
|
} else {
|
||||||
|
@ -661,7 +661,7 @@ void MicrosoftCXXNameMangler::mangleType(QualType T) {
|
||||||
// in there.
|
// in there.
|
||||||
mangleQualifiers(Quals, false);
|
mangleQualifiers(Quals, false);
|
||||||
}
|
}
|
||||||
else if (T->isPointerType()) {
|
else if (T->isAnyPointerType() || T->isMemberPointerType()) {
|
||||||
Out << 'P';
|
Out << 'P';
|
||||||
}
|
}
|
||||||
switch (T->getTypeClass()) {
|
switch (T->getTypeClass()) {
|
||||||
|
@ -1000,8 +1000,20 @@ void MicrosoftCXXNameMangler::mangleExtraDimensions(QualType ElementTy) {
|
||||||
mangleType(ElementTy.getLocalUnqualifiedType());
|
mangleType(ElementTy.getLocalUnqualifiedType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <type> ::= <pointer-to-member-type>
|
||||||
|
// <pointer-to-member-type> ::= <pointer-cvr-qualifiers> <cvr-qualifiers>
|
||||||
|
// <class name> <type>
|
||||||
void MicrosoftCXXNameMangler::mangleType(const MemberPointerType *T) {
|
void MicrosoftCXXNameMangler::mangleType(const MemberPointerType *T) {
|
||||||
assert(false && "Don't know how to mangle MemberPointerTypes yet!");
|
QualType PointeeType = T->getPointeeType();
|
||||||
|
if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(PointeeType)) {
|
||||||
|
Out << '8';
|
||||||
|
mangleName(cast<RecordType>(T->getClass())->getDecl());
|
||||||
|
mangleType(FPT, NULL, false, true);
|
||||||
|
} else {
|
||||||
|
mangleQualifiers(PointeeType.getQualifiers(), true);
|
||||||
|
mangleName(cast<RecordType>(T->getClass())->getDecl());
|
||||||
|
mangleType(PointeeType.getLocalUnqualifiedType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicrosoftCXXNameMangler::mangleType(const TemplateTypeParmType *T) {
|
void MicrosoftCXXNameMangler::mangleType(const TemplateTypeParmType *T) {
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
// CHECK: @"\01?h@@3QAHA"
|
// CHECK: @"\01?h@@3QAHA"
|
||||||
// CHECK: @"\01?i@@3PAY0BD@HA"
|
// CHECK: @"\01?i@@3PAY0BD@HA"
|
||||||
// CHECK: @"\01?j@@3P6GHCE@ZA"
|
// CHECK: @"\01?j@@3P6GHCE@ZA"
|
||||||
|
// CHECK: @"\01?k@@3PTfoo@@DA"
|
||||||
|
// CHECK: @"\01?l@@3P8foo@@AAHH@ZA"
|
||||||
|
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
|
@ -61,6 +63,10 @@ int i[10][20];
|
||||||
|
|
||||||
int (__stdcall *j)(signed char, unsigned char);
|
int (__stdcall *j)(signed char, unsigned char);
|
||||||
|
|
||||||
|
const volatile char foo::*k;
|
||||||
|
|
||||||
|
int (foo::*l)(int);
|
||||||
|
|
||||||
// Static functions are mangled, too.
|
// Static functions are mangled, too.
|
||||||
// Also make sure calling conventions, arglists, and throw specs work.
|
// Also make sure calling conventions, arglists, and throw specs work.
|
||||||
static void __stdcall alpha(float a, double b) throw() {}
|
static void __stdcall alpha(float a, double b) throw() {}
|
||||||
|
|
Loading…
Reference in New Issue