diff options
-rw-r--r-- | include/llvm/CodeGen/MachineInstrBuilder.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 05bece330c..2003f860bc 100644 --- a/include/llvm/CodeGen/MachineInstrBuilder.h +++ b/include/llvm/CodeGen/MachineInstrBuilder.h @@ -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 |