[PATCH] D38734: [MachineCombiner] Fix initialisation of LastUpdate for incremental update.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 07:44:56 PDT 2017


aemerson added inline comments.


================
Comment at: lib/CodeGen/MachineCombiner.cpp:417
   bool IncrementalUpdate = false;
   auto BlockIter = MBB->begin();
+  decltype(BlockIter) LastUpdate;
----------------
paulwalker-arm wrote:
> aemerson wrote:
> > fhahn wrote:
> > > just out of curiosity, would `auto auto BlockIter = MBB->begin(), LastUpdate;` work?
> > At this point just use the type explicitly?
> The first suggestion is not valid C++.  Given the surrounding code, decltype seems like the correct choice.  I can make the types explicit, but then why allow auto in the first place?
No objection from me, just think: `MachineBasicBlock::iterator BlockIter = MBB->begin(), LastUpdate;` is nicer in this case.

Florian I think you're good to commit.


https://reviews.llvm.org/D38734





More information about the llvm-commits mailing list