From: Chris Lattner Date: Mon, 13 Jan 2003 00:18:44 +0000 (+0000) Subject: * Add support for new types of operands X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9d4f9b990222ed46959cd0a1aef07c0923d346e6;p=oota-llvm.git * Add support for new types of operands git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5210 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h index 05bece330cb..2003f860bc0 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