return contents.SymbolName;
}
- bool isUse() const { return !IsDef; }
- bool isDef() const { return IsDef; }
- void setIsUse() { IsDef = false; }
- void setIsDef() { IsDef = true; }
+ bool isUse() const {
+ assert(isRegister() && "Wrong MachineOperand accessor");
+ return !IsDef;
+ }
+ bool isDef() const {
+ assert(isRegister() && "Wrong MachineOperand accessor");
+ return IsDef;
+ }
+ void setIsUse() {
+ assert(isRegister() && "Wrong MachineOperand accessor");
+ IsDef = false;
+ }
+ void setIsDef() {
+ assert(isRegister() && "Wrong MachineOperand accessor");
+ IsDef = true;
+ }
/// getReg - Returns the register number.
///
void addImmOperand(int64_t Val) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_Immediate;
- Op.IsDef = false;
Op.contents.immedVal = Val;
Op.offset = 0;
}
void addMachineBasicBlockOperand(MachineBasicBlock *MBB) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_MachineBasicBlock;
- Op.IsDef = false;
Op.contents.MBB = MBB;
Op.offset = 0;
}
void addFrameIndexOperand(unsigned Idx) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_FrameIndex;
- Op.IsDef = false;
Op.contents.immedVal = Idx;
Op.offset = 0;
}
void addConstantPoolIndexOperand(unsigned Idx, int Offset) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_ConstantPoolIndex;
- Op.IsDef = false;
Op.contents.immedVal = Idx;
Op.offset = Offset;
}
void addJumpTableIndexOperand(unsigned Idx) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_JumpTableIndex;
- Op.IsDef = false;
Op.contents.immedVal = Idx;
Op.offset = 0;
}
void addGlobalAddressOperand(GlobalValue *GV, int Offset) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_GlobalAddress;
- Op.IsDef = false;
Op.contents.GV = GV;
Op.offset = Offset;
}
void addExternalSymbolOperand(const char *SymName) {
MachineOperand &Op = AddNewOperand();
Op.opType = MachineOperand::MO_ExternalSymbol;
- Op.IsDef = false;
Op.contents.SymbolName = SymName;
Op.offset = 0;
}