summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-11 01:23:03 +0000
committerChris Lattner <sabre@nondot.org>2007-02-11 01:23:03 +0000
commit6e0123b17f519377e277281cf9e7a70c1b1dbb96 (patch)
tree3ab0896ce754c22324c750adef5751294b040ffb /llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
parent8d4c36bb4086e34efadb812a7a87de1e07ff5d98 (diff)
downloadbcm5719-llvm-6e0123b17f519377e277281cf9e7a70c1b1dbb96.tar.gz
bcm5719-llvm-6e0123b17f519377e277281cf9e7a70c1b1dbb96.zip
Simplify code by using value::takename
llvm-svn: 34176
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 016a421945d..e77eca11ca0 100644
--- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -224,12 +224,11 @@ bool SROA::performScalarRepl(Function &F) {
// getelement ptr instruction to finish the indexing. This may be
// expanded itself once the worklist is rerun.
//
- std::string OldName = GEPI->getName(); // Steal the old name.
std::vector<Value*> NewArgs;
NewArgs.push_back(Constant::getNullValue(Type::Int32Ty));
NewArgs.insert(NewArgs.end(), GEPI->op_begin()+3, GEPI->op_end());
- GEPI->setName("");
- RepValue = new GetElementPtrInst(AllocaToUse, NewArgs, OldName, GEPI);
+ RepValue = new GetElementPtrInst(AllocaToUse, NewArgs, "", GEPI);
+ RepValue->takeName(GEPI);
}
// Move all of the users over to the new GEP.
OpenPOWER on IntegriCloud