diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-09-04 23:35:22 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-09-04 23:35:22 +0000 |
| commit | af87314781230b12ba5d615b33e5fee97a78a3bc (patch) | |
| tree | 3f2b543113c7af146e820a69c8f9b12a8465a37f | |
| parent | 22f29396dbc646017c3ce62733d90d7885c27790 (diff) | |
| download | bcm5719-llvm-af87314781230b12ba5d615b33e5fee97a78a3bc.tar.gz bcm5719-llvm-af87314781230b12ba5d615b33e5fee97a78a3bc.zip | |
ADd getImm/setImm methods
llvm-svn: 30105
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineInstr.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index 443956e401d..c3ad83c5225 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -124,8 +124,13 @@ public: bool isGlobalAddress() const { return opType == MO_GlobalAddress; } bool isExternalSymbol() const { return opType == MO_ExternalSymbol; } + int64_t getImm() const { + assert(isImm() && "Wrong MachineOperand accessor"); + return contents.immedVal; + } + int64_t getImmedValue() const { - assert(isImmediate() && "Wrong MachineOperand accessor"); + assert(isImm() && "Wrong MachineOperand accessor"); return contents.immedVal; } MachineBasicBlock *getMachineBasicBlock() const { @@ -165,10 +170,10 @@ public: /// MachineOperand methods for testing that work on any kind of /// MachineOperand... /// - bool isUse () const { return flags & USEFLAG; } - MachineOperand& setUse () { flags |= USEFLAG; return *this; } - bool isDef () const { return flags & DEFFLAG; } - MachineOperand& setDef () { flags |= DEFFLAG; return *this; } + bool isUse() const { return flags & USEFLAG; } + bool isDef() const { return flags & DEFFLAG; } + MachineOperand &setUse() { flags |= USEFLAG; return *this; } + MachineOperand &setDef() { flags |= DEFFLAG; return *this; } /// getReg - Returns the register number. /// @@ -185,7 +190,11 @@ public: } void setImmedValue(int64_t immVal) { - assert(isImmediate() && "Wrong MachineOperand mutator"); + assert(isImm() && "Wrong MachineOperand mutator"); + contents.immedVal = immVal; + } + void setImm(int64_t immVal) { + assert(isImm() && "Wrong MachineOperand mutator"); contents.immedVal = immVal; } |

