diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-17 04:16:28 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-17 04:16:28 +0000 |
commit | 6862fc720b8e35ee4408822b2390020f263646b2 (patch) | |
tree | c1d60104446d5534fdb92ceb67ed0d4222b8cd75 /lib/CodeGen/Mangle.cpp | |
parent | 7ed5ea9146cc0c61ab8ce94feff1153c2e8cd6db (diff) |
Substitution for prefixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 9b5fd74ad5..8241ad61d0 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -55,9 +55,7 @@ namespace { void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type); private: - bool mangleSubstitution(const NamedDecl *ND) { - return mangleSubstitution(reinterpret_cast<uintptr_t>(ND)); - } + bool mangleSubstitution(const NamedDecl *ND); bool mangleSubstitution(QualType T); bool mangleSubstitution(uintptr_t Ptr); @@ -432,6 +430,10 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) { // ::= # empty // ::= <substitution> // FIXME: We only handle mangling of namespaces and classes at the moment. + + if (mangleSubstitution(cast<NamedDecl>(DC))) + return; + if (!DC->getParent()->isTranslationUnit()) manglePrefix(DC->getParent()); @@ -444,6 +446,8 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC) { } else mangleSourceName(Record->getIdentifier()); } + + addSubstitution(cast<NamedDecl>(DC)); } void @@ -922,6 +926,11 @@ void CXXNameMangler::mangleTemplateArgument(const TemplateArgument &A) { // <substitution> ::= S <seq-id> _ // ::= S_ + +bool CXXNameMangler::mangleSubstitution(const NamedDecl *ND) { + return mangleSubstitution(reinterpret_cast<uintptr_t>(ND)); +} + bool CXXNameMangler::mangleSubstitution(QualType T) { uintptr_t TypePtr = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr()); |