This is an archive of the discontinued LLVM Phabricator instance.

Rename LoopInfo::Analyze() to LoopInfo::analyze() and turn its parameter type to const&.
ClosedPublic

Authored by congh on Jul 15 2015, 4:51 PM.

Details

Summary

The benefit of turning the parameter of LoopInfo::analyze() to const& is that it now can accept a rvalue.

Diff Detail

Event Timeline

congh updated this revision to Diff 29841.Jul 15 2015, 4:51 PM
congh retitled this revision from to Rename LoopInfo::Analyze() to LoopInfo::analyze() and turn its parameter type to const&..
congh updated this object.
congh added a reviewer: dexonsmith.
congh added subscribers: llvm-commits, davidxl.
hfinkel added inline comments.
include/llvm/CodeGen/MachineDominators.h
262

The fact that this requires copy-and-paste from above is somewhat sad, could we do better (have them both inherit from a templated base class perhaps)?

include/llvm/IR/Dominators.h
149

Same comment here.

congh added inline comments.Jul 27 2015, 10:58 AM
include/llvm/CodeGen/MachineDominators.h
262

Thanks you for your suggestion! I tried creating a base class and it works well. However, we have many places with two template struct defined for T and const T in copy-and-paste style. Do you think if it is a good idea to do this for all of them?

congh updated this revision to Diff 30959.Jul 29 2015, 3:49 PM

Use class inheritance to avoid code duplication when specializing GraphTraits for T and const T.

congh updated this revision to Diff 30962.Jul 29 2015, 3:55 PM

Bug fix.

hfinkel accepted this revision.Aug 9 2015, 8:57 PM
hfinkel added a reviewer: hfinkel.

LGTM.

This revision is now accepted and ready to land.Aug 9 2015, 8:57 PM
congh closed this revision.Aug 10 2015, 10:26 AM