[PATCH] D64888: Use the MachineBasicBlock symbol for a callbr target

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 15:24:02 PDT 2019


nickdesaulniers added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp:435
+              const MachineFunction *MF = MI->getParent()->getParent();
+              for (auto I = MF->begin(), E = MF->end(); I != E; ++I)
+                if (BB == I->getBasicBlock()) {
----------------
void wrote:
> nickdesaulniers wrote:
> > range based for?
> > ```
> > for (const MachineBasicBlock& MBB : MF)
> > ...
> > ```
> > 
> > might even be able to replace `MF` with the expression above and still fit on 80 lines.
> I tried that, but never was able to get the compiler to believe that MF had a "begin()" and "end()". Eventually just gave up... I'll try again though.
maybe `*MF`?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64888/new/

https://reviews.llvm.org/D64888





More information about the llvm-commits mailing list