]> granicus.if.org Git - clang/commitdiff
Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.
authorAnders Carlsson <andersca@mac.com>
Sun, 11 Oct 2009 21:24:51 +0000 (21:24 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 11 Oct 2009 21:24:51 +0000 (21:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83793 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGRtti.cpp
lib/CodeGen/Mangle.cpp
lib/CodeGen/Mangle.h

index b8e738fb5e3efc1b8d2eb9d0e3ae723ebbb6cd57..1dde3d22b86aabdab109c5c8b82d435bc94046b8 100644 (file)
@@ -1154,8 +1154,7 @@ llvm::Value *CodeGenFunction::GenerateVtable(const CXXRecordDecl *RD) {
   llvm::SmallString<256> OutName;
   llvm::raw_svector_ostream Out(OutName);
   QualType ClassTy;
-  ClassTy = getContext().getTagDeclType(RD);
-  mangleCXXVtable(CGM.getMangleContext(), ClassTy, Out);
+  mangleCXXVtable(CGM.getMangleContext(), RD, Out);
   llvm::GlobalVariable::LinkageTypes linktype;
   linktype = llvm::GlobalValue::WeakAnyLinkage;
   std::vector<llvm::Constant *> methods;
index 15f56dc7cc5736851a1934c165079394089b37c7..7bc774fce75bca57d60caef9ae349a8bbae775d9 100644 (file)
@@ -25,9 +25,8 @@ llvm::Constant *CodeGenModule::GenerateRtti(const CXXRecordDecl *RD) {
 
   llvm::SmallString<256> OutName;
   llvm::raw_svector_ostream Out(OutName);
-  QualType ClassTy;
-  ClassTy = getContext().getTagDeclType(RD);
-  mangleCXXRtti(getMangleContext(), ClassTy, Out);
+  mangleCXXRtti(getMangleContext(), RD, Out);
+  
   llvm::GlobalVariable::LinkageTypes linktype;
   linktype = llvm::GlobalValue::WeakAnyLinkage;
   std::vector<llvm::Constant *> info;
index 9468520592a08de754bfef8107f536b29ad11fbc..fd772748dbda3e0b773b44b4f193573090308cc5 100644 (file)
@@ -51,8 +51,8 @@ namespace {
                               int64_t nv_r, int64_t v_r);
     void mangleGuardVariable(const VarDecl *D);
 
-    void mangleCXXVtable(QualType Type);
-    void mangleCXXRtti(QualType Type);
+    void mangleCXXVtable(const CXXRecordDecl *RD);
+    void mangleCXXRtti(const CXXRecordDecl *RD);
     void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type);
     void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type);
 
@@ -198,16 +198,16 @@ void CXXNameMangler::mangleCXXDtor(const CXXDestructorDecl *D,
   mangle(D);
 }
 
-void CXXNameMangler::mangleCXXVtable(QualType T) {
+void CXXNameMangler::mangleCXXVtable(const CXXRecordDecl *RD) {
   // <special-name> ::= TV <type>  # virtual table
   Out << "_ZTV";
-  mangleType(T);
+  mangleName(RD);
 }
 
-void CXXNameMangler::mangleCXXRtti(QualType T) {
+void CXXNameMangler::mangleCXXRtti(const CXXRecordDecl *RD) {
   // <special-name> ::= TI <type>  # typeinfo structure
   Out << "_ZTI";
-  mangleType(T);
+  mangleName(RD);
 }
 
 void CXXNameMangler::mangleGuardVariable(const VarDecl *D) {
@@ -1414,18 +1414,18 @@ namespace clang {
     os.flush();
   }
 
-  void mangleCXXVtable(MangleContext &Context, QualType Type,
+  void mangleCXXVtable(MangleContext &Context, const CXXRecordDecl *RD,
                        llvm::raw_ostream &os) {
     CXXNameMangler Mangler(Context, os);
-    Mangler.mangleCXXVtable(Type);
+    Mangler.mangleCXXVtable(RD);
 
     os.flush();
   }
 
-  void mangleCXXRtti(MangleContext &Context, QualType Type,
+  void mangleCXXRtti(MangleContext &Context, const CXXRecordDecl *RD,
                      llvm::raw_ostream &os) {
     CXXNameMangler Mangler(Context, os);
-    Mangler.mangleCXXRtti(Type);
+    Mangler.mangleCXXRtti(RD);
 
     os.flush();
   }
index f05220c38b26067763f80ba0f9a12965197ac28f..2cdb4e23919daaa6860868cfa9586ce182e9f77e 100644 (file)
@@ -63,8 +63,10 @@ namespace clang {
                             llvm::raw_ostream &os);
   void mangleGuardVariable(MangleContext &Context, const VarDecl *D,
                            llvm::raw_ostream &os);
-  void mangleCXXVtable(MangleContext &Context, QualType T, llvm::raw_ostream &os);
-  void mangleCXXRtti(MangleContext &Context, QualType T, llvm::raw_ostream &os);
+  void mangleCXXVtable(MangleContext &Context, const CXXRecordDecl *RD,
+                       llvm::raw_ostream &os);
+  void mangleCXXRtti(MangleContext &Context, const CXXRecordDecl *RD, 
+                     llvm::raw_ostream &os);
   void mangleCXXCtor(MangleContext &Context, const CXXConstructorDecl *D, 
                      CXXCtorType Type, llvm::raw_ostream &os);
   void mangleCXXDtor(MangleContext &Context, const CXXDestructorDecl *D,