OSDN Git Service

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)
commit0c332fd27262703bb8a98af4d7a828cb47f5e864
tree0fffed9c936b52848367886eb43fed9bfa661019
parenta4174a215c131aedd0dbdc6b4ae724a49fdc37bb
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277176 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
include/llvm/CodeGen/MachineInstrBuilder.h
lib/CodeGen/GlobalISel/IRTranslator.cpp
lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
lib/Target/AArch64/AArch64CallLowering.cpp