aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
parent694f6c81e885818840d374c855cd0c91ed3f2f15 (diff)
downloadexternal_llvm-c12430644a9f49a056286f8ebe0e55ccc23bdde0.zip
external_llvm-c12430644a9f49a056286f8ebe0e55ccc23bdde0.tar.gz
external_llvm-c12430644a9f49a056286f8ebe0e55ccc23bdde0.tar.bz2
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')
-rw-r--r--include/llvm/MC/MCInst.h23
-rw-r--r--include/llvm/Target/Target.td1
2 files changed, 23 insertions, 1 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index 8eaec7b..cadc23a 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);
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td
index 3f1cdd2..ebd826a 100644
--- a/include/llvm/Target/Target.td
+++ b/include/llvm/Target/Target.td
@@ -274,6 +274,7 @@ def unknown;
class Operand<ValueType ty> {
ValueType Type = ty;
string PrintMethod = "printOperand";
+ string AsmOperandLowerMethod = ?;
dag MIOperandInfo = (ops);
}