diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-21 09:06:31 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-21 09:06:31 +0000 |
commit | 77939c995da4ec0ed6c7e5bc8afa901d8cea9001 (patch) | |
tree | 2d7722a85651004fd079156517624f5db951aff6 /lib/CodeGen/Mangle.cpp | |
parent | 94fd26de3ae77f29496ca22d5276b2fb71b2311d (diff) |
IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index d03761ea24..377b7f421d 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -43,6 +43,12 @@ class VISIBILITY_HIDDEN CXXNameMangler { public: CXXNameMangler(MangleContext &C, llvm::SmallVectorImpl<char> &Res) : Context(C), Out(Res), Structor(0), StructorType(0) { } + CXXNameMangler(MangleContext &C, llvm::SmallVectorImpl<char> &Res, + const CXXConstructorDecl *D, CXXCtorType Type) + : Context(C), Out(Res), Structor(D), StructorType(Type) { } + CXXNameMangler(MangleContext &C, llvm::SmallVectorImpl<char> &Res, + const CXXDestructorDecl *D, CXXDtorType Type) + : Context(C), Out(Res), Structor(D), StructorType(Type) { } bool mangle(const NamedDecl *D); void mangleCalloffset(int64_t nv, int64_t v); @@ -58,8 +64,6 @@ class VISIBILITY_HIDDEN CXXNameMangler { const CXXRecordDecl *Type); void mangleCXXRtti(QualType Ty); void mangleCXXRttiName(QualType Ty); - void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type); - void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type); private: bool mangleSubstitution(const NamedDecl *ND); @@ -190,24 +194,6 @@ bool CXXNameMangler::mangle(const NamedDecl *D) { return false; } -void CXXNameMangler::mangleCXXCtor(const CXXConstructorDecl *D, - CXXCtorType Type) { - assert(!Structor && "Structor already set!"); - Structor = D; - StructorType = Type; - - mangle(D); -} - -void CXXNameMangler::mangleCXXDtor(const CXXDestructorDecl *D, - CXXDtorType Type) { - assert(!Structor && "Structor already set!"); - Structor = D; - StructorType = Type; - - mangle(D); -} - void CXXNameMangler::mangleCXXVtable(const CXXRecordDecl *RD) { // <special-name> ::= TV <type> # virtual table Out << "_ZTV"; @@ -1437,14 +1423,14 @@ void MangleContext::mangleGuardVariable(const VarDecl *D, void MangleContext::mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type, llvm::SmallVectorImpl<char> &Res) { - CXXNameMangler Mangler(*this, Res); - Mangler.mangleCXXCtor(D, Type); + CXXNameMangler Mangler(*this, Res, D, Type); + Mangler.mangle(D); } void MangleContext::mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type, llvm::SmallVectorImpl<char> &Res) { - CXXNameMangler Mangler(*this, Res); - Mangler.mangleCXXDtor(D, Type); + CXXNameMangler Mangler(*this, Res, D, Type); + Mangler.mangle(D); } void MangleContext::mangleCXXVtable(const CXXRecordDecl *RD, |