summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-12-18 03:53:28 +0000
committerPhilip Reames <listmail@philipreames.com>2015-12-18 03:53:28 +0000
commitdd0948a1b6ed0264fc0a7793bf690846faf2f97b (patch)
tree8b3aaffaf64a25cbae47fed602e5ba2b1ecfdb5c
parentf3348095e848328e9de4c83cb0b350aba0aa42fd (diff)
downloadbcm5719-llvm-dd0948a1b6ed0264fc0a7793bf690846faf2f97b.tar.gz
bcm5719-llvm-dd0948a1b6ed0264fc0a7793bf690846faf2f97b.zip
[RS4GC] Use an value handle to help isolate errors quickly
Inspired by the bug reported in 25846. Whatever we end up doing about that one, the value handle change is a generally good one since it will help catch this type of mistake more quickly. Patch by: Manuel Jacob llvm-svn: 255984
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index ffa77bb2fd6..d72133287f5 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -641,7 +641,7 @@ public:
private:
Status status;
- Value *base; // non null only if status == base
+ AssertingVH<Value> base; // non null only if status == base
};
}
@@ -1098,10 +1098,10 @@ static Value *findBasePointer(Value *I, DefiningValueMapTy &cache) {
NewInsts.erase(BaseI);
ReverseMap.erase(BaseI);
BaseI->replaceAllUsesWith(Replacement);
- BaseI->eraseFromParent();
assert(States.count(BDV));
assert(States[BDV].isConflict() && States[BDV].getBase() == BaseI);
States[BDV] = BDVState(BDVState::Conflict, Replacement);
+ BaseI->eraseFromParent();
};
const DataLayout &DL = cast<Instruction>(def)->getModule()->getDataLayout();
while (!Worklist.empty()) {
OpenPOWER on IntegriCloud