[PATCH] D34780: Make OrderedInstructions and OrderedBasicBlock use AssertingVH, to try and catch mistakes
Xin Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 28 14:18:42 PDT 2017
trentxintong created this revision.
Make OrderedInstructions and OrderedBasicBlock use AssertingVH to try and catch mistakes
https://reviews.llvm.org/D34780
Files:
include/llvm/Analysis/OrderedBasicBlock.h
include/llvm/Transforms/Utils/OrderedInstructions.h
Index: include/llvm/Transforms/Utils/OrderedInstructions.h
===================================================================
--- include/llvm/Transforms/Utils/OrderedInstructions.h
+++ include/llvm/Transforms/Utils/OrderedInstructions.h
@@ -24,12 +24,14 @@
#include "llvm/Analysis/OrderedBasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Operator.h"
+#include "llvm/IR/ValueHandle.h"
namespace llvm {
class OrderedInstructions {
/// Used to check dominance for instructions in same basic block.
- mutable DenseMap<const BasicBlock *, std::unique_ptr<OrderedBasicBlock>>
+ mutable DenseMap<AssertingVH<const BasicBlock>,
+ std::unique_ptr<OrderedBasicBlock>>
OBBMap;
/// The dominator tree of the parent function.
Index: include/llvm/Analysis/OrderedBasicBlock.h
===================================================================
--- include/llvm/Analysis/OrderedBasicBlock.h
+++ include/llvm/Analysis/OrderedBasicBlock.h
@@ -25,6 +25,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/ValueHandle.h"
namespace llvm {
@@ -34,7 +35,7 @@
class OrderedBasicBlock {
private:
/// \brief Map a instruction to its position in a BasicBlock.
- SmallDenseMap<const Instruction *, unsigned, 32> NumberedInsts;
+ SmallDenseMap<AssertingVH<const Instruction>, unsigned, 32> NumberedInsts;
/// \brief Keep track of last instruction inserted into \p NumberedInsts.
/// It speeds up queries for uncached instructions by providing a start point
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34780.104512.patch
Type: text/x-patch
Size: 1548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170628/517b97b3/attachment.bin>
More information about the llvm-commits
mailing list