push GlobalDecl through enough of the CodeGenModule interfaces
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in 
member-functions.cpp:test2, but when it does, its body should
get emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71594 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index f4eae66..4c2faf0 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -109,7 +109,7 @@
   const llvm::Type *Ty = 
     CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD), 
                                    FPT->isVariadic());
-  llvm::Constant *Callee = CGM.GetAddrOfFunction(MD, Ty);
+  llvm::Constant *Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), Ty);
   
   llvm::Value *This;
   
@@ -204,8 +204,8 @@
     getTypes().GetFunctionType(getTypes().getFunctionInfo(D), false);
   
   const char *Name = getMangledCXXCtorName(D, Type);
-  
-  return cast<llvm::Function>(GetOrCreateLLVMFunction(Name, FTy, D));
+  return cast<llvm::Function>(
+                      GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(D, Type)));
 }
 
 const char *CodeGenModule::getMangledCXXCtorName(const CXXConstructorDecl *D, 
@@ -245,7 +245,8 @@
     getTypes().GetFunctionType(getTypes().getFunctionInfo(D), false);
   
   const char *Name = getMangledCXXDtorName(D, Type);
-  return cast<llvm::Function>(GetOrCreateLLVMFunction(Name, FTy, D));
+  return cast<llvm::Function>(
+                      GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(D, Type)));
 }
 
 const char *CodeGenModule::getMangledCXXDtorName(const CXXDestructorDecl *D,