aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineInstrBuilder.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-20 18:08:09 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-20 18:08:09 +0000
commit7f6ece8a93021fb42a5f2e42507c9b2681e32f32 (patch)
tree81c3e574ad31e98708f4ebb223db892e0d59828a /include/llvm/CodeGen/MachineInstrBuilder.h
parent7b79b9862c9e6fc31ec072acb09171fd6ec7b0e0 (diff)
downloadexternal_llvm-7f6ece8a93021fb42a5f2e42507c9b2681e32f32.zip
external_llvm-7f6ece8a93021fb42a5f2e42507c9b2681e32f32.tar.gz
external_llvm-7f6ece8a93021fb42a5f2e42507c9b2681e32f32.tar.bz2
Use MachineInstrBuilder in InstrEmitter.
This is supposed to be a mechanical change with no functional effects. InstrEmitter can generate all types of MachineOperands which revealed that MachineInstrBuilder was missing a few methods, added by this patch. Besides providing a context pointer to MI::addOperand(), MachineInstrBuilder seems like a better fit for this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstrBuilder.h')
-rw-r--r--include/llvm/CodeGen/MachineInstrBuilder.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h
index d5fc636..0fc284c 100644
--- a/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -138,6 +138,13 @@ public:
return *this;
}
+ const MachineInstrBuilder &addBlockAddress(const BlockAddress *BA,
+ int64_t Offset = 0,
+ unsigned char TargetFlags = 0) const {
+ MI->addOperand(*MF, MachineOperand::CreateBA(BA, Offset, TargetFlags));
+ return *this;
+ }
+
const MachineInstrBuilder &addRegMask(const uint32_t *Mask) const {
MI->addOperand(*MF, MachineOperand::CreateRegMask(Mask));
return *this;
@@ -339,6 +346,9 @@ inline unsigned getUndefRegState(bool B) {
inline unsigned getInternalReadRegState(bool B) {
return B ? RegState::InternalRead : 0;
}
+inline unsigned getDebugRegState(bool B) {
+ return B ? RegState::Debug : 0;
+}
/// Helper class for constructing bundles of MachineInstrs.