[PATCH] D64060: [LoopInfo] Extend getExitEdges API
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 5 03:01:24 PDT 2019
fhahn added inline comments.
================
Comment at: include/llvm/Analysis/LoopInfo.h:282
+ template <class ParamBlockT>
+ void getExitEdges(SmallVectorImpl<std::pair<ParamBlockT *, ParamBlockT *> > &
+ ExitEdges) const {
----------------
skatkov wrote:
> fhahn wrote:
> > Is there a reason why the implementation was moved to here? Could it stay in LoopInfoImpl.h?
> Yes, there is a reason. To support both const and non-const ParamBlockT in SmallVector argument I introduced the new template parameter ParamBockT. As a result if I keep the implementation in LoopInfoImpl.h I have a compilation error due to users includes this header. So the movement to this header is required.
>
On second thought, it looks like getExitEdges has only a single user, so maybe it would be better to just change the original API from const to non-const and update LoopPredication?
This would be in line with most of the other APIs, that already return non-const BlockT*, exactly for the reason that most APIs expect non-const blocks.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64060/new/
https://reviews.llvm.org/D64060
More information about the llvm-commits
mailing list