Skip to content

Commit 365c7b3

Browse files
committed
SIL: update for SVN r277399
SVN r277399 introduced a new typedef requirement for the traits type.
1 parent 4ccf6c9 commit 365c7b3

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

include/swift/SIL/CFG.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace llvm {
2929
template <> struct GraphTraits<swift::SILBasicBlock*> {
3030
typedef swift::SILBasicBlock NodeType;
3131
typedef NodeType::SuccessorListTy::iterator ChildIteratorType;
32+
typedef NodeType *NodeRef;
3233

3334
static NodeType *getEntryNode(NodeType *BB) { return BB; }
3435

@@ -43,6 +44,7 @@ template <> struct GraphTraits<swift::SILBasicBlock*> {
4344
template <> struct GraphTraits<const swift::SILBasicBlock*> {
4445
typedef const swift::SILBasicBlock NodeType;
4546
typedef NodeType::ConstSuccessorListTy::iterator ChildIteratorType;
47+
typedef NodeType *NodeRef;
4648

4749
static NodeType *getEntryNode(NodeType *BB) { return BB; }
4850

@@ -57,6 +59,7 @@ template <> struct GraphTraits<const swift::SILBasicBlock*> {
5759
template <> struct GraphTraits<Inverse<swift::SILBasicBlock*> > {
5860
typedef swift::SILBasicBlock NodeType;
5961
typedef NodeType::pred_iterator ChildIteratorType;
62+
typedef NodeType *NodeRef;
6063

6164
static NodeType *getEntryNode(Inverse<swift::SILBasicBlock *> G) {
6265
return G.Graph;
@@ -72,6 +75,8 @@ template <> struct GraphTraits<Inverse<swift::SILBasicBlock*> > {
7275
template <> struct GraphTraits<Inverse<const swift::SILBasicBlock*> > {
7376
typedef const swift::SILBasicBlock NodeType;
7477
typedef NodeType::pred_iterator ChildIteratorType;
78+
typedef NodeType *NodeRef;
79+
7580
static NodeType *getEntryNode(Inverse<const swift::SILBasicBlock *> G) {
7681
return G.Graph;
7782
}
@@ -86,6 +91,7 @@ template <> struct GraphTraits<Inverse<const swift::SILBasicBlock*> > {
8691
template <> struct GraphTraits<swift::SILFunction*>
8792
: public GraphTraits<swift::SILBasicBlock*> {
8893
typedef swift::SILFunction *GraphType;
94+
typedef NodeType *NodeRef;
8995

9096
static NodeType *getEntryNode(GraphType F) { return &F->front(); }
9197

@@ -94,9 +100,11 @@ template <> struct GraphTraits<swift::SILFunction*>
94100
static nodes_iterator nodes_end(GraphType F) { return F->end(); }
95101
static unsigned size(GraphType F) { return F->size(); }
96102
};
103+
97104
template <> struct GraphTraits<Inverse<swift::SILFunction*> >
98105
: public GraphTraits<Inverse<swift::SILBasicBlock*> > {
99106
typedef Inverse<swift::SILFunction *> GraphType;
107+
typedef NodeType *NodeRef;
100108

101109
static NodeType *getEntryNode(GraphType F) { return &F.Graph->front(); }
102110

include/swift/SIL/Dominance.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ namespace llvm {
170170
template <> struct GraphTraits<swift::DominanceInfoNode *> {
171171
using NodeType = swift::DominanceInfoNode;
172172
using ChildIteratorType = NodeType::iterator;
173+
typedef NodeType *NodeRef;
173174

174175
static NodeType *getEntryNode(NodeType *N) { return N; }
175176
static inline ChildIteratorType child_begin(NodeType *N) {
@@ -181,6 +182,7 @@ template <> struct GraphTraits<swift::DominanceInfoNode *> {
181182
template <> struct GraphTraits<const swift::DominanceInfoNode *> {
182183
using NodeType = const swift::DominanceInfoNode;
183184
using ChildIteratorType = NodeType::const_iterator;
185+
typedef NodeType *NodeRef;
184186

185187
static NodeType *getEntryNode(NodeType *N) { return N; }
186188
static inline ChildIteratorType child_begin(NodeType *N) {

lib/SILOptimizer/Mandatory/MandatoryInlining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ getCalleeFunction(FullApplySite AI, bool &IsThick,
199199
// If we find the load instruction first, then the load is loading from
200200
// a non-initialized alloc; this shouldn't really happen but I'm not
201201
// making any assumptions
202-
if (static_cast<SILInstruction*>(I) == LI)
202+
if (&*I == LI)
203203
return nullptr;
204204
if ((SI = dyn_cast<StoreInst>(I)) && SI->getDest() == PBI) {
205205
// We found a store that we know dominates the load; now ensure there

0 commit comments

Comments
 (0)