[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstrBuilder.h
Evan Cheng
evan.cheng at apple.com
Mon Nov 13 15:32:47 PST 2006
Changes in directory llvm/include/llvm/CodeGen:
MachineInstrBuilder.h updated: 1.39 -> 1.40
---
Log message:
Matches MachineInstr changes.
---
Diffs of the changes: (+15 -14)
MachineInstrBuilder.h | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
Index: llvm/include/llvm/CodeGen/MachineInstrBuilder.h
diff -u llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.39 llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.40
--- llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.39 Sat Nov 11 04:19:03 2006
+++ llvm/include/llvm/CodeGen/MachineInstrBuilder.h Mon Nov 13 17:32:33 2006
@@ -18,6 +18,8 @@
#define LLVM_CODEGEN_MACHINEINSTRBUILDER_H
#include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/Target/TargetMachine.h"
namespace llvm {
@@ -33,8 +35,9 @@
/// addReg - Add a new virtual register operand...
///
- const MachineInstrBuilder &addReg(int RegNo, bool isDef = false,
- bool isImp = false) const {
+ const
+ MachineInstrBuilder &addReg(int RegNo, bool isDef = false, bool isImp = false,
+ bool isKill = false, bool isDead = false) const {
MI->addRegOperand(RegNo, isDef, isImp);
return *this;
}
@@ -77,28 +80,24 @@
MI->addExternalSymbolOperand(FnName);
return *this;
}
-
- const MachineInstrBuilder &addImplicitDefsUses() const {
- MI->addImplicitDefUseOperands();
- return *this;
- }
};
/// BuildMI - Builder interface. Specify how to create the initial instruction
/// itself. NumOperands is the number of operands to the machine instruction to
/// allow for memory efficient representation of machine instructions.
///
-inline MachineInstrBuilder BuildMI(int Opcode, unsigned NumOperands) {
- return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands));
+inline MachineInstrBuilder BuildMI(const TargetInstrInfo &TII, int Opcode,
+ unsigned NumOperands) {
+ return MachineInstrBuilder(new MachineInstr(TII, Opcode, NumOperands));
}
/// BuildMI - This version of the builder sets up the first operand as a
/// destination virtual register. NumOperands is the number of additional add*
/// calls that are expected, not including the destination register.
///
-inline MachineInstrBuilder
-BuildMI(int Opcode, unsigned NumOperands, unsigned DestReg) {
- return MachineInstrBuilder(new MachineInstr(Opcode, NumOperands+1))
+inline MachineInstrBuilder BuildMI(const TargetInstrInfo &TII, int Opcode,
+ unsigned NumOperands, unsigned DestReg) {
+ return MachineInstrBuilder(new MachineInstr(TII, Opcode, NumOperands+1))
.addReg(DestReg, true);
}
@@ -112,7 +111,8 @@
MachineBasicBlock::iterator I,
int Opcode, unsigned NumOperands,
unsigned DestReg) {
- MachineInstr *MI = new MachineInstr(Opcode, NumOperands+1);
+ MachineInstr *MI = new MachineInstr(*BB.getParent()->getTarget().
+ getInstrInfo(), Opcode, NumOperands+1);
BB.insert(I, MI);
return MachineInstrBuilder(MI).addReg(DestReg, true);
}
@@ -124,7 +124,8 @@
inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
MachineBasicBlock::iterator I,
int Opcode, unsigned NumOperands) {
- MachineInstr *MI = new MachineInstr(Opcode, NumOperands);
+ MachineInstr *MI = new MachineInstr(*BB.getParent()->getTarget().
+ getInstrInfo(), Opcode, NumOperands);
BB.insert(I, MI);
return MachineInstrBuilder(MI);
}
More information about the llvm-commits
mailing list