* Add support for new types of operands

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-01-13 00:18:44 +00:00
parent 3c8cbe6567
commit 9d4f9b9902

View 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