[cfe-commits] r81481 - in /cfe/trunk/lib/CodeGen: CGCXX.cpp CGDecl.cpp CGExpr.cpp CGExprConstant.cpp CodeGenModule.cpp

Anders Carlsson andersca at mac.com
Thu Sep 10 16:43:36 PDT 2009


Author: andersca
Date: Thu Sep 10 18:43:36 2009
New Revision: 81481

URL: http://llvm.org/viewvc/llvm-project?rev=81481&view=rev
Log:
GlobalDecl doesn't have an explicit constructor anymore.

Modified:
    cfe/trunk/lib/CodeGen/CGCXX.cpp
    cfe/trunk/lib/CodeGen/CGDecl.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CGExprConstant.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Thu Sep 10 18:43:36 2009
@@ -227,7 +227,7 @@
              = dyn_cast<CXXDestructorDecl>(MD))
     Callee = CGM.GetAddrOfFunction(GlobalDecl(Destructor, Dtor_Complete), Ty);
   else
-    Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), Ty);
+    Callee = CGM.GetAddrOfFunction(MD, Ty);
 
   return EmitCXXMemberCall(MD, Callee, This,
                            CE->arg_begin(), CE->arg_end());
@@ -256,7 +256,7 @@
   const llvm::Type *Ty =
     CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
                                    FPT->isVariadic());
-  llvm::Constant *Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), Ty);
+  llvm::Constant *Callee = CGM.GetAddrOfFunction(MD, Ty);
 
   llvm::Value *This = EmitLValue(E->getArg(0)).getAddress();
 
@@ -576,8 +576,7 @@
   // Emit the call to new.
   RValue RV =
     EmitCall(CGM.getTypes().getFunctionInfo(NewFTy->getResultType(), NewArgs),
-             CGM.GetAddrOfFunction(GlobalDecl(NewFD)),
-             NewArgs, NewFD);
+             CGM.GetAddrOfFunction(NewFD), NewArgs, NewFD);
 
   // If an allocation function is declared with an empty exception specification
   // it returns null to indicate failure to allocate storage. [expr.new]p13.
@@ -699,7 +698,7 @@
   // Emit the call to delete.
   EmitCall(CGM.getTypes().getFunctionInfo(DeleteFTy->getResultType(),
                                           DeleteArgs),
-           CGM.GetAddrOfFunction(GlobalDecl(DeleteFD)),
+           CGM.GetAddrOfFunction(DeleteFD),
            DeleteArgs, DeleteFD);
 
   EmitBlock(DeleteEnd);
@@ -900,7 +899,7 @@
          mi != e; ++mi) {
       const CXXMethodDecl *OMD = *mi;
       llvm::Constant *om;
-      om = CGM.GetAddrOfFunction(GlobalDecl(OMD), Ptr8Ty);
+      om = CGM.GetAddrOfFunction(OMD, Ptr8Ty);
       om = llvm::ConstantExpr::getBitCast(om, Ptr8Ty);
 
       for (Index_t i = 0, e = submethods.size();
@@ -964,8 +963,7 @@
            ++mi)
         if (mi->isVirtual()) {
           const CXXMethodDecl *MD = *mi;
-          llvm::Constant *m = wrap(CGM.GetAddrOfFunction(GlobalDecl(MD),
-                                                         Ptr8Ty));
+          llvm::Constant *m = wrap(CGM.GetAddrOfFunction(MD, Ptr8Ty));
           OverrideMethod(MD, m, MorallyVirtual, Offset);
         }
     }
@@ -1440,7 +1438,7 @@
     const llvm::Type *LTy =
     CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
                                    FPT->isVariadic());
-    llvm::Constant *Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), LTy);
+    llvm::Constant *Callee = CGM.GetAddrOfFunction(MD, LTy);
 
     CallArgList CallArgs;
     // Push the this (Dest) ptr.
@@ -1532,7 +1530,7 @@
   const llvm::Type *LTy =
     CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
                                    FPT->isVariadic());
-  llvm::Constant *Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), LTy);
+  llvm::Constant *Callee = CGM.GetAddrOfFunction(MD, LTy);
 
   CallArgList CallArgs;
   // Push the this (Dest) ptr.

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Thu Sep 10 18:43:36 2009
@@ -468,7 +468,7 @@
   if (const CleanupAttr *CA = D.getAttr<CleanupAttr>()) {
     const FunctionDecl *FD = CA->getFunctionDecl();
 
-    llvm::Constant* F = CGM.GetAddrOfFunction(GlobalDecl(FD));
+    llvm::Constant* F = CGM.GetAddrOfFunction(FD);
     assert(F && "Could not find function!");
 
     CleanupScope scope(*this);

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Thu Sep 10 18:43:36 2009
@@ -744,7 +744,7 @@
       LV.SetGlobalObjCRef(LV, true);
     return LV;
   } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(E->getDecl())) {
-    llvm::Value* V = CGM.GetAddrOfFunction(GlobalDecl(FD));
+    llvm::Value* V = CGM.GetAddrOfFunction(FD);
     if (!FD->hasPrototype()) {
       if (const FunctionProtoType *Proto =
               FD->getType()->getAsFunctionProtoType()) {

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Thu Sep 10 18:43:36 2009
@@ -601,7 +601,7 @@
     case Expr::QualifiedDeclRefExprClass: {
       NamedDecl *Decl = cast<DeclRefExpr>(E)->getDecl();
       if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(Decl))
-        return CGM.GetAddrOfFunction(GlobalDecl(FD));
+        return CGM.GetAddrOfFunction(FD);
       if (const VarDecl* VD = dyn_cast<VarDecl>(Decl)) {
         // We can never refer to a variable with local storage.
         if (!VD->hasLocalStorage()) {

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Sep 10 18:43:36 2009
@@ -743,7 +743,7 @@
     if (!BaseClassDecl->hasTrivialCopyAssignment() &&
         !BaseClassDecl->hasUserDeclaredCopyAssignment() &&
         BaseClassDecl->hasConstCopyAssignment(getContext(), MD))
-      GetAddrOfFunction(GlobalDecl(MD), 0);
+      GetAddrOfFunction(MD, 0);
   }
 
   for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(),
@@ -761,7 +761,7 @@
       if (!FieldClassDecl->hasTrivialCopyAssignment() &&
           !FieldClassDecl->hasUserDeclaredCopyAssignment() &&
           FieldClassDecl->hasConstCopyAssignment(getContext(), MD))
-          GetAddrOfFunction(GlobalDecl(MD), 0);
+          GetAddrOfFunction(MD, 0);
     }
   }
   DeferredDeclsToEmit.push_back(CopyAssignDecl);
@@ -919,7 +919,7 @@
     // later.
     const char *MangledName = getMangledName(D);
     if (GlobalDeclMap.count(MangledName) == 0) {
-      DeferredDecls[MangledName] = GlobalDecl(D);
+      DeferredDecls[MangledName] = D;
       return;
     }
   }
@@ -1640,10 +1640,11 @@
     if (cast<FunctionDecl>(D)->getDescribedFunctionTemplate())
       return;
 
-    // Fall through
-
+    EmitGlobal(cast<FunctionDecl>(D));
+    break;
+      
   case Decl::Var:
-    EmitGlobal(GlobalDecl(cast<VarDecl>(D)));
+    EmitGlobal(cast<VarDecl>(D));
     break;
 
   // C++ Decls





More information about the cfe-commits mailing list