This is an archive of the discontinued LLVM Phabricator instance.

[GraphTraits] Replace all NodeType usage with NodeRef
ClosedPublic

Authored by timshen on Aug 19 2016, 4:42 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

timshen updated this revision to Diff 68748.Aug 19 2016, 4:42 PM
timshen retitled this revision from to [GraphTraits] Replace all NodeType usage with NodeRef.
timshen updated this object.
timshen added a reviewer: dblaikie.
timshen added subscribers: llvm-commits, cfe-commits.
dblaikie edited edge metadata.Aug 22 2016, 11:25 AM

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?

llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
684–688

If you like you could probably (separate commit) drop the 'inline' from these functions, they're implicitly inline anyway

llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
2060–2064

and here

llvm/trunk/include/llvm/IR/CFG.h
161–164

And here.. and so on.

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?

I think those traits are unused. Notice that by merely removing "NodeType *" declarations, the build/tests doesn't break, so at least they are not covered by the tests.

llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
684–688

Sure, I can do that in a following patch.

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?

I think those traits are unused. Notice that by merely removing "NodeType *" declarations, the build/tests doesn't break, so at least they are not covered by the tests.

I'd sort of be inclined to remove them, then - but I leave that up to you.

Otherwise this review is already approved, so commit as you see fit.

dblaikie accepted this revision.Aug 22 2016, 1:58 PM
dblaikie edited edge metadata.

Or it isn't approved (was mixing up reviews) - but now it is...

This revision is now accepted and ready to land.Aug 22 2016, 1:58 PM

I'd sort of be inclined to remove them, then - but I leave that up to you.

It looks like people create some class, and add GraphTraits specialization for it, in the hope that others can use it, but didn't write a test. The right thing is to add the test, but I'm not going to be the one. :)

So I'll keep them.

This revision was automatically updated to reflect the committed changes.