From 101e2cab0b9f2dc98f4df9f81da884db0c6fe98e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 29 Dec 2009 08:03:58 +0000 Subject: [PATCH] remove useless argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92256 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CloneFunction.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 995d6e4baa7..09af8ae925b 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -347,8 +347,7 @@ ConstantFoldMappedInstruction(const Instruction *I) { Ops.size(), TD); } -static MDNode *UpdateInlinedAtInfo(MDNode *InsnMD, MDNode *TheCallMD, - LLVMContext &Context) { +static MDNode *UpdateInlinedAtInfo(MDNode *InsnMD, MDNode *TheCallMD) { DILocation ILoc(InsnMD); if (ILoc.isNull()) return InsnMD; @@ -358,14 +357,14 @@ static MDNode *UpdateInlinedAtInfo(MDNode *InsnMD, MDNode *TheCallMD, DILocation OrigLocation = ILoc.getOrigLocation(); MDNode *NewLoc = TheCallMD; if (!OrigLocation.isNull()) - NewLoc = UpdateInlinedAtInfo(OrigLocation.getNode(), TheCallMD, Context); + NewLoc = UpdateInlinedAtInfo(OrigLocation.getNode(), TheCallMD); SmallVector MDVs; MDVs.push_back(InsnMD->getElement(0)); // Line MDVs.push_back(InsnMD->getElement(1)); // Col MDVs.push_back(InsnMD->getElement(2)); // Scope MDVs.push_back(NewLoc); - return MDNode::get(Context, MDVs.data(), MDVs.size()); + return MDNode::get(InsnMD->getContext(), MDVs.data(), MDVs.size()); } /// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto, @@ -421,8 +420,8 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, // BasicBlock::iterator I = NewBB->begin(); - LLVMContext &Context = OldFunc->getContext(); - unsigned DbgKind = Context.getMetadata().getMDKindID("dbg"); + // FIXME: Only use of context. + unsigned DbgKind = OldFunc->getContext().getMetadata().getMDKindID("dbg"); MDNode *TheCallMD = NULL; SmallVector MDVs; if (TheCall && TheCall->hasMetadata()) @@ -437,7 +436,7 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, if (I->hasMetadata()) { if (TheCallMD) { if (MDNode *IMD = I->getMetadata(DbgKind)) { - MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD, Context); + MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD); I->setMetadata(DbgKind, NewMD); } } else { @@ -461,7 +460,7 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, if (I->hasMetadata()) { if (TheCallMD) { if (MDNode *IMD = I->getMetadata(DbgKind)) { - MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD, Context); + MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD); I->setMetadata(DbgKind, NewMD); } } else {