mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 23:31:37 +00:00
Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
215da0c040
commit
9e45d2e0e8
@ -26,6 +26,7 @@
|
||||
#include "Support/Debug.h"
|
||||
#include "Support/Statistic.h"
|
||||
#include "Support/STLExtras.h"
|
||||
#include <algorithm>
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
@ -206,6 +207,14 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
|
||||
PHIOps.insert(PHIOps.end(), MaybeDead->op_begin(),
|
||||
MaybeDead->op_end());
|
||||
MaybeDead->getParent()->getInstList().erase(MaybeDead);
|
||||
|
||||
// Erase any duplicates entries in the PHIOps list.
|
||||
std::vector<Value*>::iterator It =
|
||||
std::find(PHIOps.begin(), PHIOps.end(), MaybeDead);
|
||||
while (It != PHIOps.end()) {
|
||||
PHIOps.erase(It);
|
||||
It = std::find(PHIOps.begin(), PHIOps.end(), MaybeDead);
|
||||
}
|
||||
|
||||
// Erasing the instruction could invalidate the AfterPHI iterator!
|
||||
AfterPHIIt = Header->begin();
|
||||
|
Loading…
x
Reference in New Issue
Block a user