diff options
Diffstat (limited to 'lib/Target/CppBackend')
-rw-r--r-- | lib/Target/CppBackend/SimplifyAllocas.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/CppBackend/SimplifyAllocas.cpp b/lib/Target/CppBackend/SimplifyAllocas.cpp index 0aca53bc50..1d4823ec57 100644 --- a/lib/Target/CppBackend/SimplifyAllocas.cpp +++ b/lib/Target/CppBackend/SimplifyAllocas.cpp @@ -94,11 +94,11 @@ bool SimplifyAllocas::runOnFunction(Function &Func) { NA->takeName(AI); NA->setAlignment(AI->getAlignment()); NA->setDebugLoc(AI->getDebugLoc()); - ToRemove.push_back(AI); for (unsigned i = 0; i < Aliases.size(); i++) { Aliases[i]->replaceAllUsesWith(NA); ToRemove.push_back(Aliases[i]); } + ToRemove.push_back(AI); Changed = true; } } |