aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-26 05:11:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-26 05:11:13 +0000
commit1b12a3bb4d4c0db74fc97be724beefec7366b460 (patch)
treeb6521401d47cee173b874228d2a365edd8cc06ba /lib/CodeGen
parent400b06dde52df439b25264fbbc0271d96d27903c (diff)
Be sure to use the standard substitutions when mangling the names of
vtables, VTTs, and construction vtables. Fixes PR7201. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/Mangle.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 88e4c647c8..cf7a74bf42 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -108,7 +108,8 @@ public:
void mangleFunctionEncoding(const FunctionDecl *FD);
void mangleName(const NamedDecl *ND);
void mangleType(QualType T);
-
+ void mangleNameOrStandardSubstitution(const NamedDecl *ND);
+
private:
bool mangleSubstitution(const NamedDecl *ND);
bool mangleSubstitution(QualType T);
@@ -1025,6 +1026,11 @@ void CXXNameMangler::mangleType(QualType T) {
addSubstitution(T);
}
+void CXXNameMangler::mangleNameOrStandardSubstitution(const NamedDecl *ND) {
+ if (!mangleStandardSubstitution(ND))
+ mangleName(ND);
+}
+
void CXXNameMangler::mangleType(const BuiltinType *T) {
// <type> ::= <builtin-type>
// <builtin-type> ::= v # void
@@ -2137,7 +2143,7 @@ void MangleContext::mangleCXXVTable(const CXXRecordDecl *RD,
// <special-name> ::= TV <type> # virtual table
CXXNameMangler Mangler(*this, Res);
Mangler.getStream() << "_ZTV";
- Mangler.mangleName(RD);
+ Mangler.mangleNameOrStandardSubstitution(RD);
}
void MangleContext::mangleCXXVTT(const CXXRecordDecl *RD,
@@ -2145,7 +2151,7 @@ void MangleContext::mangleCXXVTT(const CXXRecordDecl *RD,
// <special-name> ::= TT <type> # VTT structure
CXXNameMangler Mangler(*this, Res);
Mangler.getStream() << "_ZTT";
- Mangler.mangleName(RD);
+ Mangler.mangleNameOrStandardSubstitution(RD);
}
void MangleContext::mangleCXXCtorVTable(const CXXRecordDecl *RD, int64_t Offset,
@@ -2154,10 +2160,10 @@ void MangleContext::mangleCXXCtorVTable(const CXXRecordDecl *RD, int64_t Offset,
// <special-name> ::= TC <type> <offset number> _ <base type>
CXXNameMangler Mangler(*this, Res);
Mangler.getStream() << "_ZTC";
- Mangler.mangleName(RD);
+ Mangler.mangleNameOrStandardSubstitution(RD);
Mangler.getStream() << Offset;
Mangler.getStream() << '_';
- Mangler.mangleName(Type);
+ Mangler.mangleNameOrStandardSubstitution(Type);
}
void MangleContext::mangleCXXRTTI(QualType Ty,