[cfe-commits] r89549 - /cfe/trunk/lib/CodeGen/Mangle.cpp

Daniel Dunbar daniel at zuster.org
Sat Nov 21 01:06:31 PST 2009


Author: ddunbar
Date: Sat Nov 21 03:06:31 2009
New Revision: 89549

URL: http://llvm.org/viewvc/llvm-project?rev=89549&view=rev
Log:
IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.

Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=89549&r1=89548&r2=89549&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Sat Nov 21 03:06:31 2009
@@ -43,6 +43,12 @@
   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 @@
                            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 @@
   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::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,





More information about the cfe-commits mailing list