llvm.org GIT mirror llvm / 70e6b37
Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch mistakes Summary: Make OrderedInstructions and OrderedBasicBlock use AssertingVH to try and catch mistakes Reviewers: efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34780 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306605 91177308-0d34-0410-b5e6-96231b3b80d8 Xin Tong 2 years ago
2 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2424
2525 #include "llvm/ADT/DenseMap.h"
2626 #include "llvm/IR/BasicBlock.h"
27 #include "llvm/IR/ValueHandle.h"
2728
2829 namespace llvm {
2930
3334 class OrderedBasicBlock {
3435 private:
3536 /// \brief Map a instruction to its position in a BasicBlock.
36 SmallDenseMap<const Instruction *, unsigned, 32> NumberedInsts;
37 SmallDenseMap<AssertingVH, unsigned, 32> NumberedInsts;
3738
3839 /// \brief Keep track of last instruction inserted into \p NumberedInsts.
3940 /// It speeds up queries for uncached instructions by providing a start point
2323 #include "llvm/Analysis/OrderedBasicBlock.h"
2424 #include "llvm/IR/Dominators.h"
2525 #include "llvm/IR/Operator.h"
26 #include "llvm/IR/ValueHandle.h"
2627
2728 namespace llvm {
2829
2930 class OrderedInstructions {
3031 /// Used to check dominance for instructions in same basic block.
31 mutable DenseMap>
32 OBBMap;
32 mutable DenseMap,
33 std::unique_ptr> OBBMap;
3334
3435 /// The dominator tree of the parent function.
3536 DominatorTree *DT;