[PATCH] D23730: [GraphTraits] Replace all NodeType usage with NodeRef
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 22 11:25:36 PDT 2016
dblaikie added a comment.
Not all of these already had NodeRef implemented - that implies that some algorithms weren't using NodeRef before this change, or that these traits are unused? I thought the plan was to migrate each algorithm then just do a strict cleanup. Did that not pan out/some other aspects I'm forgetting?
================
Comment at: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h:684-688
@@ -684,7 +683,7 @@
typedef SUnitIterator ChildIteratorType;
- static inline NodeType *getEntryNode(SUnit *N) { return N; }
- static inline ChildIteratorType child_begin(NodeType *N) {
+ static inline NodeRef getEntryNode(SUnit *N) { return N; }
+ static inline ChildIteratorType child_begin(NodeRef N) {
return SUnitIterator::begin(N);
}
- static inline ChildIteratorType child_end(NodeType *N) {
+ static inline ChildIteratorType child_end(NodeRef N) {
return SUnitIterator::end(N);
----------------
If you like you could probably (separate commit) drop the 'inline' from these functions, they're implicitly inline anyway
================
Comment at: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h:2060-2064
@@ -2060,7 +2059,7 @@
typedef SDNodeIterator ChildIteratorType;
- static inline NodeType *getEntryNode(SDNode *N) { return N; }
- static inline ChildIteratorType child_begin(NodeType *N) {
+ static inline NodeRef getEntryNode(SDNode *N) { return N; }
+ static inline ChildIteratorType child_begin(NodeRef N) {
return SDNodeIterator::begin(N);
}
- static inline ChildIteratorType child_end(NodeType *N) {
+ static inline ChildIteratorType child_end(NodeRef N) {
return SDNodeIterator::end(N);
----------------
and here
================
Comment at: llvm/trunk/include/llvm/IR/CFG.h:161-164
@@ -163,6 +160,6 @@
+ static NodeRef getEntryNode(BasicBlock *BB) { return BB; }
+ static inline ChildIteratorType child_begin(NodeRef N) {
return succ_begin(N);
}
- static inline ChildIteratorType child_end(NodeType *N) {
- return succ_end(N);
- }
+ static inline ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
};
----------------
And here.. and so on.
https://reviews.llvm.org/D23730
More information about the cfe-commits
mailing list