summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCInst.h
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-15 16:24:01 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-15 16:24:01 +0000
commit0dd2c9331887b9d0aa06b1e201c5eda4361365fc (patch)
tree4766142a5f52d32d5b5eef24bfd11324bed774f5 /include/llvm/MC/MCInst.h
parent85dbce31d02894233f8cfd15a5cc08f2d3fba3eb (diff)
downloadllvm-0dd2c9331887b9d0aa06b1e201c5eda4361365fc.tar.gz
llvm-0dd2c9331887b9d0aa06b1e201c5eda4361365fc.tar.bz2
llvm-0dd2c9331887b9d0aa06b1e201c5eda4361365fc.tar.xz
trailing whitespace and 80 column cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCInst.h')
-rw-r--r--include/llvm/MC/MCInst.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index dc630fe280..bd1b58a05a 100644
--- a/include/llvm/MC/MCInst.h
+++ b/include/llvm/MC/MCInst.h
@@ -36,21 +36,21 @@ class MCOperand {
kExpr ///< Relocatable immediate operand.
};
unsigned char Kind;
-
+
union {
unsigned RegVal;
int64_t ImmVal;
const MCExpr *ExprVal;
};
public:
-
+
MCOperand() : Kind(kInvalid) {}
bool isValid() const { return Kind != kInvalid; }
bool isReg() const { return Kind == kRegister; }
bool isImm() const { return Kind == kImmediate; }
bool isExpr() const { return Kind == kExpr; }
-
+
/// getReg - Returns the register number.
unsigned getReg() const {
assert(isReg() && "This is not a register operand!");
@@ -62,7 +62,7 @@ public:
assert(isReg() && "This is not a register operand!");
RegVal = Reg;
}
-
+
int64_t getImm() const {
assert(isImm() && "This is not an immediate");
return ImmVal;
@@ -71,7 +71,7 @@ public:
assert(isImm() && "This is not an immediate");
ImmVal = Val;
}
-
+
const MCExpr *getExpr() const {
assert(isExpr() && "This is not an expression");
return ExprVal;
@@ -80,7 +80,7 @@ public:
assert(isExpr() && "This is not an expression");
ExprVal = Val;
}
-
+
static MCOperand CreateReg(unsigned Reg) {
MCOperand Op;
Op.Kind = kRegister;
@@ -104,23 +104,23 @@ public:
void dump() const;
};
-
+
/// MCInst - Instances of this class represent a single low-level machine
-/// instruction.
+/// instruction.
class MCInst {
unsigned Opcode;
SmallVector<MCOperand, 8> Operands;
public:
MCInst() : Opcode(0) {}
-
+
void setOpcode(unsigned Op) { Opcode = Op; }
-
+
unsigned getOpcode() const { return Opcode; }
const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
MCOperand &getOperand(unsigned i) { return Operands[i]; }
unsigned getNumOperands() const { return Operands.size(); }
-
+
void addOperand(const MCOperand &Op) {
Operands.push_back(Op);
}