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

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 15:26:27 PDT 2019


void marked an inline comment as done.
void 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()) {
----------------
nickdesaulniers wrote:
> 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`?
That gives me this error *sigh*:

```
error: use of deleted function ‘llvm::MachineBasicBlock::MachineBasicBlock(const llvm::MachineBasicBlock&)’
```


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