aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-19 19:19:01 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-19 19:19:01 +0000
commit433cb080bac56b4fac56f7625e07e17b4824ce8a (patch)
treee5a1fa1348d1b09231ceeea3e38001ebbbaa13bf /include/llvm/CodeGen/MachineInstr.h
parente7ff165a4049619ea121f35c3492d57c7e44180e (diff)
Add an MF argument to MachineInstr::addOperand().
Just like for addMemOperand(), the function pointer provides a context for allocating memory. This will make it possible to use a better memory allocation strategy for the MI operand list, which is currently a slow std::vector. Most calls to addOperand() come from MachineInstrBuilder, so give that class an MF reference as well. Code using BuildMI() won't need changing at all since the MF reference is already required to allocate a MachineInstr. Future patches will fix code that calls MI::addOperand(Op) directly, as well as code that uses the now deprecated MachineInstrBuilder(MI) constructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170574 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 0418b0400d..e7099db6ed 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -952,6 +952,14 @@ public:
/// (before the first implicit operand).
void addOperand(const MachineOperand &Op);
+ // Add an operand while providing a context pointer. This will replace the
+ // single-argument function shortly.
+ //
+ // MF must be the machine function that was used to allocate this instruction.
+ void addOperand(MachineFunction &MF, const MachineOperand &Op) {
+ addOperand(Op);
+ }
+
/// setDesc - Replace the instruction descriptor (thus opcode) of
/// the current instruction with a new one.
///