[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Sep 4 16:35:37 PDT 2006
Changes in directory llvm/include/llvm/CodeGen:
MachineInstr.h updated: 1.183 -> 1.184
---
Log message:
ADd getImm/setImm methods
---
Diffs of the changes: (+15 -6)
MachineInstr.h | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.183 llvm/include/llvm/CodeGen/MachineInstr.h:1.184
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.183 Mon Sep 4 18:05:29 2006
+++ llvm/include/llvm/CodeGen/MachineInstr.h Mon Sep 4 18:35:22 2006
@@ -124,8 +124,13 @@
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 @@
/// 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 @@
}
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;
}
More information about the llvm-commits
mailing list