* Add support for new types of operands
authorChris Lattner <sabre@nondot.org>
Mon, 13 Jan 2003 00:18:44 +0000 (00:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 13 Jan 2003 00:18:44 +0000 (00:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5210 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstrBuilder.h

index 05bece330cb01fe2b70b03e0749381feb5798075..2003f860bc01c26cf007af0403a2feb3b4c6504c 100644 (file)
@@ -18,9 +18,9 @@
 
 #include "llvm/CodeGen/MachineInstr.h"
 
-struct MachineInstrBuilder {
+class MachineInstrBuilder {
   MachineInstr *MI;
-
+public:
   MachineInstrBuilder(MachineInstr *mi) : MI(mi) {}
 
   /// Allow automatic conversion to the machine instruction we are working on.
@@ -91,6 +91,23 @@ struct MachineInstrBuilder {
     MI->addFrameIndexOperand(Idx);
     return *this;
   }
+
+  const MachineInstrBuilder &addConstantPoolIndex(unsigned Idx) const {
+    MI->addConstantPoolIndexOperand(Idx);
+    return *this;
+  }
+
+  const MachineInstrBuilder &addGlobalAddress(GlobalValue *GV,
+                                             bool isPCRelative = false) const {
+    MI->addGlobalAddressOperand(GV, isPCRelative);
+    return *this;
+  }
+
+  const MachineInstrBuilder &addExternalSymbol(const std::string &Name,
+                                              bool isPCRelative = false) const{
+    MI->addExternalSymbolOperand(Name, isPCRelative);
+    return *this;
+  }
 };
 
 /// BuildMI - Builder interface.  Specify how to create the initial instruction