Skip to content

SIL: update for SVN r277399 #3967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/swift/SIL/CFG.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace llvm {
template <> struct GraphTraits<swift::SILBasicBlock*> {
typedef swift::SILBasicBlock NodeType;
typedef NodeType::SuccessorListTy::iterator ChildIteratorType;
typedef NodeType *NodeRef;

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

Expand All @@ -43,6 +44,7 @@ template <> struct GraphTraits<swift::SILBasicBlock*> {
template <> struct GraphTraits<const swift::SILBasicBlock*> {
typedef const swift::SILBasicBlock NodeType;
typedef NodeType::ConstSuccessorListTy::iterator ChildIteratorType;
typedef NodeType *NodeRef;

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

Expand All @@ -57,6 +59,7 @@ template <> struct GraphTraits<const swift::SILBasicBlock*> {
template <> struct GraphTraits<Inverse<swift::SILBasicBlock*> > {
typedef swift::SILBasicBlock NodeType;
typedef NodeType::pred_iterator ChildIteratorType;
typedef NodeType *NodeRef;

static NodeType *getEntryNode(Inverse<swift::SILBasicBlock *> G) {
return G.Graph;
Expand All @@ -72,6 +75,8 @@ template <> struct GraphTraits<Inverse<swift::SILBasicBlock*> > {
template <> struct GraphTraits<Inverse<const swift::SILBasicBlock*> > {
typedef const swift::SILBasicBlock NodeType;
typedef NodeType::pred_iterator ChildIteratorType;
typedef NodeType *NodeRef;

static NodeType *getEntryNode(Inverse<const swift::SILBasicBlock *> G) {
return G.Graph;
}
Expand All @@ -86,6 +91,7 @@ template <> struct GraphTraits<Inverse<const swift::SILBasicBlock*> > {
template <> struct GraphTraits<swift::SILFunction*>
: public GraphTraits<swift::SILBasicBlock*> {
typedef swift::SILFunction *GraphType;
typedef NodeType *NodeRef;

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

Expand All @@ -94,9 +100,11 @@ template <> struct GraphTraits<swift::SILFunction*>
static nodes_iterator nodes_end(GraphType F) { return F->end(); }
static unsigned size(GraphType F) { return F->size(); }
};

template <> struct GraphTraits<Inverse<swift::SILFunction*> >
: public GraphTraits<Inverse<swift::SILBasicBlock*> > {
typedef Inverse<swift::SILFunction *> GraphType;
typedef NodeType *NodeRef;

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

Expand Down
2 changes: 2 additions & 0 deletions include/swift/SIL/Dominance.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ namespace llvm {
template <> struct GraphTraits<swift::DominanceInfoNode *> {
using NodeType = swift::DominanceInfoNode;
using ChildIteratorType = NodeType::iterator;
typedef NodeType *NodeRef;

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

static NodeType *getEntryNode(NodeType *N) { return N; }
static inline ChildIteratorType child_begin(NodeType *N) {
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/MandatoryInlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ getCalleeFunction(FullApplySite AI, bool &IsThick,
// If we find the load instruction first, then the load is loading from
// a non-initialized alloc; this shouldn't really happen but I'm not
// making any assumptions
if (static_cast<SILInstruction*>(I) == LI)
if (&*I == LI)
return nullptr;
if ((SI = dyn_cast<StoreInst>(I)) && SI->getDest() == PBI) {
// We found a store that we know dominates the load; now ensure there
Expand Down