summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-14 01:47:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-14 01:47:49 +0000
commit3108798ecbb2d6d07bdaf1f2b604b0cbe30c4094 (patch)
treeef2533ee8b3b353d35da0b77d148a2b15f7fbefe /llvm
parent63eb03f80090fb6cf23d45be358fac961f21b306 (diff)
downloadbcm5719-llvm-3108798ecbb2d6d07bdaf1f2b604b0cbe30c4094.tar.gz
bcm5719-llvm-3108798ecbb2d6d07bdaf1f2b604b0cbe30c4094.zip
Add an MO_Undef MachineOperandType, intended for INSERT_SUBREG. Next up MO_Undead.
llvm-svn: 48353
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/MachineInstrBuilder.h5
-rw-r--r--llvm/include/llvm/CodeGen/MachineOperand.h15
2 files changed, 16 insertions, 4 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
index 51900603ac9..06f5bf06d9e 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -84,6 +84,11 @@ public:
return *this;
}
+ const MachineInstrBuilder &addUndef() const {
+ MI->addOperand(MachineOperand::CreateUndef());
+ return *this;
+ }
+
/// addMemOperand - Add a memory operand to the machine instruction.
const MachineInstrBuilder &addMemOperand(const MemOperand &MO) const {
MI->addMemOperand(MO);
diff --git a/llvm/include/llvm/CodeGen/MachineOperand.h b/llvm/include/llvm/CodeGen/MachineOperand.h
index d62c8f8b474..b4601e18fa7 100644
--- a/llvm/include/llvm/CodeGen/MachineOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineOperand.h
@@ -33,15 +33,16 @@ class MachineRegisterInfo;
class MachineOperand {
public:
enum MachineOperandType {
- MO_Register, // Register operand.
- MO_Immediate, // Immediate Operand
- MO_FPImmediate,
+ MO_Register, // Register operand
+ MO_Immediate, // Immediate operand
+ MO_FPImmediate, // FP immediate operand
MO_MachineBasicBlock, // MachineBasicBlock reference
MO_FrameIndex, // Abstract Stack Frame Index
MO_ConstantPoolIndex, // Address of indexed Constant in Constant Pool
MO_JumpTableIndex, // Address of indexed Jump Table for switch
MO_ExternalSymbol, // Name of external global symbol
- MO_GlobalAddress // Address of a global value
+ MO_GlobalAddress, // Address of a global value
+ MO_Undef // Undef
};
private:
@@ -130,6 +131,7 @@ public:
bool isJumpTableIndex() const { return OpKind == MO_JumpTableIndex; }
bool isGlobalAddress() const { return OpKind == MO_GlobalAddress; }
bool isExternalSymbol() const { return OpKind == MO_ExternalSymbol; }
+ bool isUndef() const { return OpKind == MO_Undef; }
bool isReg() const { return OpKind == MO_Register; }
bool isImm() const { return OpKind == MO_Immediate; }
@@ -375,6 +377,11 @@ public:
Op.setOffset(Offset);
return Op;
}
+ static MachineOperand CreateUndef() {
+ MachineOperand Op(MachineOperand::MO_Undef);
+ return Op;
+ }
+
const MachineOperand &operator=(const MachineOperand &MO) {
OpKind = MO.OpKind;
IsDef = MO.IsDef;
OpenPOWER on IntegriCloud