add method
authorChris Lattner <sabre@nondot.org>
Fri, 20 Oct 2006 18:00:03 +0000 (18:00 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 20 Oct 2006 18:00:03 +0000 (18:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31066 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index 6ec01a6b8c14454e67c96d2fe704fbb7a7f9288d..b3955b6c198d8ecd1d7e824c5f772f17f13d2948 100644 (file)
@@ -70,9 +70,18 @@ public:
   MachineOperand(const MachineOperand &M) {
     *this = M;
   }
-
+  
   ~MachineOperand() {}
-
+  
+  static MachineOperand CreateImm(int64_t Val) {
+    MachineOperand Op;
+    Op.opType = MachineOperand::MO_Immediate;
+    Op.contents.immedVal = Val;
+    Op.IsDef = false;
+    Op.offset = 0;
+    return Op;
+  }
+  
   const MachineOperand &operator=(const MachineOperand &MO) {
     contents = MO.contents;
     IsDef    = MO.IsDef;