summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-04 18:05:43 +0000
committerChris Lattner <sabre@nondot.org>2006-05-04 18:05:43 +0000
commit2d90ac7ca6117d3b160dde8a4f322c1079a6ffce (patch)
tree2100b8964e5214d3119d5e8a7c0f5bd1682f1fc3 /include/llvm
parent68ab4c6367f34e6320c5f0ce22b85f800bdcfd81 (diff)
downloadllvm-2d90ac7ca6117d3b160dde8a4f322c1079a6ffce.tar.gz
llvm-2d90ac7ca6117d3b160dde8a4f322c1079a6ffce.tar.bz2
llvm-2d90ac7ca6117d3b160dde8a4f322c1079a6ffce.tar.xz
Rename MO_VirtualRegister -> MO_Register. Clean up immediate handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h45
-rw-r--r--include/llvm/CodeGen/MachineInstrBuilder.h8
2 files changed, 19 insertions, 34 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 557b1a3bb6..0cf822aa0e 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -61,7 +61,7 @@ public:
};
enum MachineOperandType {
- MO_VirtualRegister, // virtual register for *value
+ MO_Register, // Register operand.
MO_Immediate, // Immediate Operand
MO_MachineBasicBlock, // MachineBasicBlock reference
MO_FrameIndex, // Abstract Stack Frame Index
@@ -93,12 +93,17 @@ private:
extra.offset = 0;
}
- MachineOperand(int64_t ImmVal, MachineOperandType OpTy, int Offset = 0)
- : flags(0), opType(OpTy) {
+ MachineOperand(int64_t ImmVal) : flags(0), opType(MO_Immediate) {
contents.immedVal = ImmVal;
- extra.offset = Offset;
+ extra.offset = 0;
}
+ MachineOperand(unsigned Idx, MachineOperandType OpTy)
+ : flags(0), opType(OpTy) {
+ contents.immedVal = Idx;
+ extra.offset = 0;
+ }
+
MachineOperand(int Reg, MachineOperandType OpTy, UseType UseTy)
: flags(UseTy), opType(OpTy) {
zeroContents();
@@ -152,7 +157,7 @@ public:
/// Accessors that tell you what kind of MachineOperand you're looking at.
///
- bool isRegister() const { return opType == MO_VirtualRegister; }
+ bool isRegister() const { return opType == MO_Register; }
bool isImmediate() const { return opType == MO_Immediate; }
bool isMachineBasicBlock() const { return opType == MO_MachineBasicBlock; }
bool isFrameIndex() const { return opType == MO_FrameIndex; }
@@ -245,7 +250,7 @@ public:
/// the specified value. If an operand is known to be an register already,
/// the setReg method should be used.
void ChangeToRegister(unsigned Reg) {
- opType = MO_VirtualRegister;
+ opType = MO_Register;
extra.regNum = Reg;
}
@@ -355,41 +360,21 @@ public:
/// addRegOperand - Add a symbolic virtual register reference...
///
- void addRegOperand(int reg, bool isDef) {
- assert(!OperandsComplete() &&
- "Trying to add an operand to a machine instr that is already done!");
- operands.push_back(
- MachineOperand(reg, MachineOperand::MO_VirtualRegister,
- isDef ? MachineOperand::Def : MachineOperand::Use));
- }
-
- /// addRegOperand - Add a symbolic virtual register reference...
- ///
void addRegOperand(int reg,
MachineOperand::UseType UTy = MachineOperand::Use) {
assert(!OperandsComplete() &&
"Trying to add an operand to a machine instr that is already done!");
operands.push_back(
- MachineOperand(reg, MachineOperand::MO_VirtualRegister, UTy));
+ MachineOperand(reg, MachineOperand::MO_Register, UTy));
}
- /// addZeroExtImmOperand - Add a zero extended constant argument to the
+ /// addImmOperand - Add a zero extended constant argument to the
/// machine instruction.
///
- void addZeroExtImmOperand(int intValue) {
- assert(!OperandsComplete() &&
- "Trying to add an operand to a machine instr that is already done!");
- operands.push_back(
- MachineOperand(intValue, MachineOperand::MO_Immediate));
- }
-
- /// addZeroExtImm64Operand - Add a zero extended 64-bit constant argument
- /// to the machine instruction.
- ///
- void addZeroExtImm64Operand(uint64_t intValue) {
+ void addImmOperand(int64_t Val) {
assert(!OperandsComplete() &&
"Trying to add an operand to a machine instr that is already done!");
- operands.push_back(MachineOperand(intValue, MachineOperand::MO_Immediate));
+ operands.push_back(MachineOperand(Val));
}
void addMachineBasicBlockOperand(MachineBasicBlock *MBB) {
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h
index 3a25ea2f11..36ee998cbc 100644
--- a/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -42,22 +42,22 @@ public:
/// addImm - Add a new immediate operand.
///
- const MachineInstrBuilder &addImm(int Val) const {
- MI->addZeroExtImmOperand(Val);
+ const MachineInstrBuilder &addImm(int64_t Val) const {
+ MI->addImmOperand(Val);
return *this;
}
/// addZImm - Add a new zero extended immediate operand...
///
const MachineInstrBuilder &addZImm(unsigned Val) const {
- MI->addZeroExtImmOperand(Val);
+ MI->addImmOperand(Val);
return *this;
}
/// addImm64 - Add a new 64-bit immediate operand...
///
const MachineInstrBuilder &addImm64(uint64_t Val) const {
- MI->addZeroExtImm64Operand(Val);
+ MI->addImmOperand(Val);
return *this;
}