diff options
Diffstat (limited to 'lib/Transforms/Scalar/ScalarReplAggregates.cpp')
-rw-r--r-- | lib/Transforms/Scalar/ScalarReplAggregates.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 016a421945..e77eca11ca 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/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. |