GlobalDecl doesn't have an explicit constructor anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81481 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 828892a..e169881 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -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.
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 5abe31e..82c1c02 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -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);
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index dde6899..ba9828c 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -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()) {
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index bea6d80..4f1b29b 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -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()) {
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 37e283a..064f3ef 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -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