summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCInst.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-31 08:08:38 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-31 08:08:38 +0000
commit8c2eebe4074ef218b30d94358f6b2e45c079605c (patch)
treee44c45883a8e8d40ba8b2529f467378cb0233538 /include/llvm/MC/MCInst.h
parentc18274ba9cabd5699452870daae3c2d9accecc37 (diff)
downloadllvm-8c2eebe4074ef218b30d94358f6b2e45c079605c.tar.gz
llvm-8c2eebe4074ef218b30d94358f6b2e45c079605c.tar.bz2
llvm-8c2eebe4074ef218b30d94358f6b2e45c079605c.tar.xz
llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCInst.h')
-rw-r--r--include/llvm/MC/MCInst.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index 857d29411e..7c1cb136d6 100644
--- a/include/llvm/MC/MCInst.h
+++ b/include/llvm/MC/MCInst.h
@@ -16,13 +16,13 @@
#ifndef LLVM_MC_MCINST_H
#define LLVM_MC_MCINST_H
-#include "llvm/MC/MCValue.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/DebugLoc.h"
namespace llvm {
class raw_ostream;
+class MCExpr;
/// MCOperand - Instances of this class represent operands of the MCInst class.
/// This is a simple discriminated union.
@@ -32,14 +32,14 @@ class MCOperand {
kRegister, ///< Register operand.
kImmediate, ///< Immediate operand.
kMBBLabel, ///< Basic block label.
- kMCValue ///< Relocatable immediate operand.
+ kExpr ///< Relocatable immediate operand.
};
unsigned char Kind;
union {
unsigned RegVal;
int64_t ImmVal;
- MCValue MCValueVal;
+ const MCExpr *ExprVal;
struct {
unsigned FunctionNo;
unsigned BlockNo;
@@ -54,7 +54,7 @@ public:
bool isReg() const { return Kind == kRegister; }
bool isImm() const { return Kind == kImmediate; }
bool isMBBLabel() const { return Kind == kMBBLabel; }
- bool isMCValue() const { return Kind == kMCValue; }
+ bool isExpr() const { return Kind == kExpr; }
/// getReg - Returns the register number.
unsigned getReg() const {
@@ -78,21 +78,21 @@ public:
}
unsigned getMBBLabelFunction() const {
- assert(isMBBLabel() && "Wrong accessor");
+ assert(isMBBLabel() && "This is not a machine basic block");
return MBBLabel.FunctionNo;
}
unsigned getMBBLabelBlock() const {
- assert(isMBBLabel() && "Wrong accessor");
+ assert(isMBBLabel() && "This is not a machine basic block");
return MBBLabel.BlockNo;
}
- const MCValue &getMCValue() const {
- assert(isMCValue() && "This is not an MCValue");
- return MCValueVal;
+ const MCExpr *getExpr() const {
+ assert(isExpr() && "This is not an expression");
+ return ExprVal;
}
- void setMCValue(const MCValue &Val) {
- assert(isMCValue() && "This is not an MCValue");
- MCValueVal = Val;
+ void setExpr(const MCExpr *Val) {
+ assert(isExpr() && "This is not an expression");
+ ExprVal = Val;
}
static MCOperand CreateReg(unsigned Reg) {
@@ -114,10 +114,10 @@ public:
Op.MBBLabel.BlockNo = MBB;
return Op;
}
- static MCOperand CreateMCValue(const MCValue &Val) {
+ static MCOperand CreateExpr(const MCExpr *Val) {
MCOperand Op;
- Op.Kind = kMCValue;
- Op.MCValueVal = Val;
+ Op.Kind = kExpr;
+ Op.ExprVal = Val;
return Op;
}