r206012 - Cleanup: Add default arguments to CodeGenFunction::StartFunction.
Adrian Prantl
aprantl at apple.com
Thu Apr 10 18:13:04 PDT 2014
Author: adrian
Date: Thu Apr 10 20:13:04 2014
New Revision: 206012
URL: http://llvm.org/viewvc/llvm-project?rev=206012&view=rev
Log:
Cleanup: Add default arguments to CodeGenFunction::StartFunction.
Thanks dblaikie for the suggestion!
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=206012&r1=206011&r2=206012&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Thu Apr 10 20:13:04 2014
@@ -1307,7 +1307,7 @@ CodeGenFunction::GenerateCopyHelperFunct
false);
// Create a scope with an artificial location for the body of this function.
ArtificialLocation AL(*this, Builder);
- StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());
+ StartFunction(FD, C.VoidTy, Fn, FI, args);
AL.Emit();
llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();
@@ -1477,7 +1477,7 @@ CodeGenFunction::GenerateDestroyHelperFu
false, false);
// Create a scope with an artificial location for the body of this function.
ArtificialLocation AL(*this, Builder);
- StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());
+ StartFunction(FD, C.VoidTy, Fn, FI, args);
AL.Emit();
llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();
@@ -1766,7 +1766,7 @@ generateByrefCopyHelper(CodeGenFunction
SC_Static,
false, false);
- CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation(), SourceLocation());
+ CGF.StartFunction(FD, R, Fn, FI, args);
if (byrefInfo.needsCopy()) {
llvm::Type *byrefPtrType = byrefType.getPointerTo(0);
@@ -1835,7 +1835,7 @@ generateByrefDisposeHelper(CodeGenFuncti
SourceLocation(), II, R, 0,
SC_Static,
false, false);
- CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation(), SourceLocation());
+ CGF.StartFunction(FD, R, Fn, FI, args);
if (byrefInfo.needsDispose()) {
llvm::Value *V = CGF.GetAddrOfLocalVar(&src);
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=206012&r1=206011&r2=206012&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Thu Apr 10 20:13:04 2014
@@ -178,8 +178,7 @@ static llvm::Constant *createAtExitStub(
CodeGenFunction CGF(CGM);
CGF.StartFunction(&VD, CGM.getContext().VoidTy, fn,
- CGM.getTypes().arrangeNullaryFunction(), FunctionArgList(),
- SourceLocation(), SourceLocation());
+ CGM.getTypes().arrangeNullaryFunction(), FunctionArgList());
llvm::CallInst *call = CGF.Builder.CreateCall(dtor, addr);
@@ -433,8 +432,7 @@ CodeGenFunction::GenerateCXXGlobalInitFu
ArrayRef<llvm::Constant *> Decls,
llvm::GlobalVariable *Guard) {
StartFunction(GlobalDecl(), getContext().VoidTy, Fn,
- getTypes().arrangeNullaryFunction(),
- FunctionArgList(), SourceLocation(), SourceLocation());
+ getTypes().arrangeNullaryFunction(), FunctionArgList());
llvm::BasicBlock *ExitBlock = 0;
if (Guard) {
@@ -479,8 +477,7 @@ void CodeGenFunction::GenerateCXXGlobalD
const std::vector<std::pair<llvm::WeakVH, llvm::Constant*> >
&DtorsAndObjects) {
StartFunction(GlobalDecl(), getContext().VoidTy, Fn,
- getTypes().arrangeNullaryFunction(),
- FunctionArgList(), SourceLocation(), SourceLocation());
+ getTypes().arrangeNullaryFunction(), FunctionArgList());
// Emit the dtors, in reverse order from construction.
for (unsigned i = 0, e = DtorsAndObjects.size(); i != e; ++i) {
@@ -510,8 +507,7 @@ llvm::Function *CodeGenFunction::generat
llvm::Function *fn =
CreateGlobalInitOrDestructFunction(CGM, FTy, "__cxx_global_array_dtor");
- StartFunction(VD, getContext().VoidTy, fn, FI, args,
- SourceLocation(), SourceLocation());
+ StartFunction(VD, getContext().VoidTy, fn, FI, args);
emitDestroy(addr, type, destroyer, useEHCleanupForArray);
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=206012&r1=206011&r2=206012&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Thu Apr 10 20:13:04 2014
@@ -2916,7 +2916,7 @@ CodeGenFunction::GenerateObjCAtomicSette
"__assign_helper_atomic_property_",
&CGM.getModule());
- StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());
+ StartFunction(FD, C.VoidTy, Fn, FI, args);
DeclRefExpr DstExpr(&dstDecl, false, DestTy,
VK_RValue, SourceLocation());
@@ -2994,7 +2994,7 @@ CodeGenFunction::GenerateObjCAtomicGette
llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage,
"__copy_helper_atomic_property_", &CGM.getModule());
- StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());
+ StartFunction(FD, C.VoidTy, Fn, FI, args);
DeclRefExpr SrcExpr(&srcDecl, false, SrcTy,
VK_RValue, SourceLocation());
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=206012&r1=206011&r2=206012&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Apr 10 20:13:04 2014
@@ -1148,8 +1148,8 @@ public:
llvm::Function *Fn,
const CGFunctionInfo &FnInfo,
const FunctionArgList &Args,
- SourceLocation Loc,
- SourceLocation StartLoc);
+ SourceLocation Loc = SourceLocation(),
+ SourceLocation StartLoc = SourceLocation());
void EmitConstructorBody(FunctionArgList &Args);
void EmitDestructorBody(FunctionArgList &Args);
More information about the cfe-commits
mailing list