[PATCH] D152468: [NFC][DebugInfo][RemoveDIs] Use iterators over instruction pointers when using IRBuilder in various passes
Jeremy Morse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 08:46:15 PDT 2023
jmorse added inline comments.
================
Comment at: llvm/include/llvm/IR/BasicBlock.h:179
+ InstListType::const_iterator getFirstNonPHIIt() const;
+ InstListType::iterator getFirstNonPHIIt() {
+ BasicBlock::iterator It = static_cast<const BasicBlock *>(this)->getFirstNonPHIIt().getNonConst();
----------------
Orlando wrote:
> nit: please clang-format. Also, any reason that the `const` version is implemented in the .cpp file while this one is in the header?
In the cpp file -> I'm following the convention of the immediately preceeding (in this hunk) `getFirstNonPHI` which does the same thing. I don't know why `getFirstNonPHI` was written like that, but it makes sense to copy it here IMO.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152468/new/
https://reviews.llvm.org/D152468
More information about the llvm-commits
mailing list