CodeGen: improve MachineInstrBuilder & MachineIRBuilder interface
authorTim Northover <tnorthover@apple.com>
Fri, 29 Jul 2016 17:43:52 +0000 (17:43 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 29 Jul 2016 17:43:52 +0000 (17:43 +0000)
commita51575ffa215c0a3558740694b3831b773498d15
tree048bb4ac6b2c5627602ae3ee21700acd6627aefa
parent48c7cc9bc04f595b7b335aeae83df4c0221b6d13
CodeGen: improve MachineInstrBuilder & MachineIRBuilder interface

For MachineInstrBuilder, having to manually use RegState::Define is ugly and
makes register definitions clunkier than they need to be, so this adds two
convenience functions: addDef and addUse.

For MachineIRBuilder, we want to avoid BuildMI's first-reg-is-def rule because
it's hidden away and causes bugs. So this patch switches buildInstr to
returning a MachineInstrBuilder and adding *all* operands via addDef/addUse.

NFC.

llvm-svn: 277176
llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
llvm/include/llvm/CodeGen/MachineInstrBuilder.h
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
llvm/lib/Target/AArch64/AArch64CallLowering.cpp