#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.
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