aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
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);
}