aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-29 08:03:58 +0000
committerChris Lattner <sabre@nondot.org>2009-12-29 08:03:58 +0000
commit101e2cab0b9f2dc98f4df9f81da884db0c6fe98e (patch)
tree5e4277c4a5d53c85986e1e804ac94a56d02c0ed0 /lib/Transforms/Utils/CloneFunction.cpp
parentb17f65829c44142827e4c3b9a062ee5cc84f566d (diff)
remove useless argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index 995d6e4baa..09af8ae925 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<Value *, 4> 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<Value *, 4> 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 {