[cfe-commits] r105672 - /cfe/trunk/lib/CodeGen/CGCXX.cpp

Anders Carlsson andersca at mac.com
Tue Jun 8 19:30:13 PDT 2010


Author: andersca
Date: Tue Jun  8 21:30:12 2010
New Revision: 105672

URL: http://llvm.org/viewvc/llvm-project?rev=105672&view=rev
Log:
More mangling cleanup.

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

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=105672&r1=105671&r2=105672&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Tue Jun  8 21:30:12 2010
@@ -218,8 +218,10 @@
 llvm::GlobalValue *
 CodeGenModule::GetAddrOfCXXConstructor(const CXXConstructorDecl *D,
                                        CXXCtorType Type) {
+  GlobalDecl GD(D, Type);
+  
   MangleBuffer Name;
-  getMangledCXXCtorName(Name, D, Type);
+  getMangledName(Name, GD);
   if (llvm::GlobalValue *V = GetGlobalValue(Name))
     return V;
 
@@ -227,8 +229,7 @@
   const llvm::FunctionType *FTy =
     getTypes().GetFunctionType(getTypes().getFunctionInfo(D, Type), 
                                FPT->isVariadic());
-  return cast<llvm::Function>(
-                      GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(D, Type)));
+  return cast<llvm::Function>(GetOrCreateLLVMFunction(Name, FTy, GD));
 }
 
 void CodeGenModule::getMangledName(MangleBuffer &Buffer, const BlockDecl *BD) {
@@ -286,16 +287,17 @@
 llvm::GlobalValue *
 CodeGenModule::GetAddrOfCXXDestructor(const CXXDestructorDecl *D,
                                       CXXDtorType Type) {
+  GlobalDecl GD(D, Type);
+
   MangleBuffer Name;
-  getMangledCXXDtorName(Name, D, Type);
+  getMangledName(Name, GD);
   if (llvm::GlobalValue *V = GetGlobalValue(Name))
     return V;
 
   const llvm::FunctionType *FTy =
     getTypes().GetFunctionType(getTypes().getFunctionInfo(D, Type), false);
 
-  return cast<llvm::Function>(
-                      GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(D, Type)));
+  return cast<llvm::Function>(GetOrCreateLLVMFunction(Name, FTy, GD));
 }
 
 void CodeGenModule::getMangledCXXDtorName(MangleBuffer &Name,





More information about the cfe-commits mailing list