summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 1d2f4f1095..cf35abe4a0 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -17,6 +17,7 @@
#define LLVM_CODEGEN_MACHINEINSTR_H
#include "llvm/ADT/iterator"
+#include "llvm/Support/DataTypes.h"
#include <vector>
#include <cassert>
@@ -117,7 +118,7 @@ private:
// the generated machine code.
// LLVM global for MO_GlobalAddress.
- int immedVal; // Constant value for an explicit constant
+ int64_t immedVal; // Constant value for an explicit constant
MachineBasicBlock *MBB; // For MO_MachineBasicBlock type
const char *SymbolName; // For MO_ExternalSymbol type
@@ -138,7 +139,8 @@ private:
memset (&extra, 0, sizeof (extra));
}
- MachineOperand(int ImmVal = 0, MachineOperandType OpTy = MO_VirtualRegister)
+ MachineOperand(int64_t ImmVal = 0,
+ MachineOperandType OpTy = MO_VirtualRegister)
: flags(0), opType(OpTy) {
zeroContents ();
contents.immedVal = ImmVal;
@@ -259,7 +261,7 @@ public:
assert(opType == MO_MachineRegister && "Wrong MachineOperand accessor");
return extra.regNum;
}
- int getImmedValue() const {
+ int64_t getImmedValue() const {
assert(isImmediate() && "Wrong MachineOperand accessor");
return contents.immedVal;
}
@@ -605,6 +607,16 @@ public:
MachineOperand(intValue, MachineOperand::MO_UnextendedImmed));
}
+ /// addZeroExtImm64Operand - Add a zero extended 64-bit constant argument
+ /// to the machine instruction.
+ ///
+ void addZeroExtImm64Operand(uint64_t intValue) {
+ assert(!OperandsComplete() &&
+ "Trying to add an operand to a machine instr that is already done!");
+ operands.push_back(
+ MachineOperand(intValue, MachineOperand::MO_UnextendedImmed));
+ }
+
/// addSignExtImmOperand - Add a zero extended constant argument to the
/// machine instruction.
///