[PATCH] D36636: [GISel][NFC]: Add some constructors for easy creation of MIRBuilders

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 09:19:50 PDT 2017


qcolombet added inline comments.


================
Comment at: include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h:91
+  MachineIRBuilder(MachineFunction &MF) { setMF(MF); }
+  MachineIRBuilder(MachineFunction &MF, MachineInstr &MI) {
+    setMF(MF);
----------------
aditya_nandakumar wrote:
> qcolombet wrote:
> > We could have a constructor with only MI, if that makes the usage simpler:
> > MachineIRBuilder(MI) : MachineIRBuild(MI.getParent()->getParent()) {
> > setInstr(MI);
> > }
> You mean - instead of the above two constructors, only have one which takes MI?
> 
No, I mean one with MF, one with MI instead of the pair (MF MI).
That being said if you prefer (MF, MI) instead of (MI) that works for me.


Repository:
  rL LLVM

https://reviews.llvm.org/D36636





More information about the llvm-commits mailing list