summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCInst.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-20 07:03:18 +0000
committerChris Lattner <sabre@nondot.org>2009-06-20 07:03:18 +0000
commitc12430644a9f49a056286f8ebe0e55ccc23bdde0 (patch)
tree40b96f97a28a3ce6e9e2635ffebac6e4e627653e /include/llvm/MC/MCInst.h
parent694f6c81e885818840d374c855cd0c91ed3f2f15 (diff)
downloadllvm-c12430644a9f49a056286f8ebe0e55ccc23bdde0.tar.gz
llvm-c12430644a9f49a056286f8ebe0e55ccc23bdde0.tar.bz2
llvm-c12430644a9f49a056286f8ebe0e55ccc23bdde0.tar.xz
implement support for lowering subregs when preparing to print
LEA64_32r, eliminating a bunch of modifier logic stuff on addr modes. Implement support for printing mbb labels as operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCInst.h')
-rw-r--r--include/llvm/MC/MCInst.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index 8eaec7b372..cadc23ab71 100644
--- a/include/llvm/MC/MCInst.h
+++ b/include/llvm/MC/MCInst.h
@@ -29,13 +29,18 @@ class MCOperand {
enum MachineOperandType {
kInvalid, ///< Uninitialized.
kRegister, ///< Register operand.
- kImmediate ///< Immediate operand.
+ kImmediate, ///< Immediate operand.
+ kMBBLabel ///< Basic block label.
};
unsigned char Kind;
union {
unsigned RegVal;
int64_t ImmVal;
+ struct {
+ unsigned FunctionNo;
+ unsigned BlockNo;
+ } MBBLabel;
};
public:
@@ -44,6 +49,7 @@ public:
bool isReg() const { return Kind == kRegister; }
bool isImm() const { return Kind == kImmediate; }
+ bool isMBBLabel() const { return Kind == kMBBLabel; }
/// getReg - Returns the register number.
unsigned getReg() const {
@@ -66,6 +72,15 @@ public:
ImmVal = Val;
}
+ unsigned getMBBLabelFunction() const {
+ assert(isMBBLabel() && "Wrong accessor");
+ return MBBLabel.FunctionNo;
+ }
+ unsigned getMBBLabelBlock() const {
+ assert(isMBBLabel() && "Wrong accessor");
+ return MBBLabel.BlockNo;
+ }
+
void MakeReg(unsigned Reg) {
Kind = kRegister;
RegVal = Reg;
@@ -74,6 +89,11 @@ public:
Kind = kImmediate;
ImmVal = Val;
}
+ void MakeMBBLabel(unsigned Fn, unsigned MBB) {
+ Kind = kMBBLabel;
+ MBBLabel.FunctionNo = Fn;
+ MBBLabel.BlockNo = MBB;
+ }
};
@@ -91,6 +111,7 @@ public:
DebugLoc getDebugLoc() const { return DebugLoc(); }
const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
+ MCOperand &getOperand(unsigned i) { return Operands[i]; }
void addOperand(const MCOperand &Op) {
Operands.push_back(Op);