aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-01-13 00:18:44 +0000
committerChris Lattner <sabre@nondot.org>2003-01-13 00:18:44 +0000
commit9d4f9b990222ed46959cd0a1aef07c0923d346e6 (patch)
tree8aca7e608bdd2c4874bdfa65b2d76e9e85f56667
parent3c8cbe6567c94fdd24ec9b2b8b5c5cc1b01a8c58 (diff)
* Add support for new types of operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5210 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineInstrBuilder.h21
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