aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/ADCE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/ADCE.cpp')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 63612768f4..20e4367033 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -189,8 +189,8 @@ bool ADCE::doADCE() {
// The function cannot unwind. Convert it to a call with a branch
// after it to the normal destination.
std::vector<Value*> Args(II->op_begin()+3, II->op_end());
- std::string Name = II->getName(); II->setName("");
- CallInst *NewCall = new CallInst(F, Args, Name, II);
+ CallInst *NewCall = new CallInst(F, Args, "", II);
+ NewCall->takeName(II);
NewCall->setCallingConv(II->getCallingConv());
II->replaceAllUsesWith(NewCall);
new BranchInst(II->getNormalDest(), II);