diff options
author | Philip Reames <listmail@philipreames.com> | 2015-12-18 03:53:28 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2015-12-18 03:53:28 +0000 |
commit | dd0948a1b6ed0264fc0a7793bf690846faf2f97b (patch) | |
tree | 8b3aaffaf64a25cbae47fed602e5ba2b1ecfdb5c | |
parent | f3348095e848328e9de4c83cb0b350aba0aa42fd (diff) | |
download | bcm5719-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.cpp | 4 |
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()) { |