[llvm-commits] [llvm] r48353 - in /llvm/trunk/include/llvm/CodeGen: MachineInstrBuilder.h MachineOperand.h

Evan Cheng evan.cheng at apple.com
Thu Mar 13 18:47:49 PDT 2008


Author: evancheng
Date: Thu Mar 13 20:47:49 2008
New Revision: 48353

URL: http://llvm.org/viewvc/llvm-project?rev=48353&view=rev
Log:
Add an MO_Undef MachineOperandType, intended for INSERT_SUBREG. Next up MO_Undead.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
    llvm/trunk/include/llvm/CodeGen/MachineOperand.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=48353&r1=48352&r2=48353&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Thu Mar 13 20:47:49 2008
@@ -84,6 +84,11 @@
     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);

Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=48353&r1=48352&r2=48353&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Thu Mar 13 20:47:49 2008
@@ -33,15 +33,16 @@
 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 @@
   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 @@
     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;





More information about the llvm-commits mailing list