aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineInstrBuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/MachineInstrBuilder.h')
-rw-r--r--include/llvm/CodeGen/MachineInstrBuilder.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineInstrBuilder.h b/include/llvm/CodeGen/MachineInstrBuilder.h
index d594d1b025..a360be6de3 100644
--- a/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -34,13 +34,22 @@ struct MachineInstrBuilder {
return *this;
}
- /// addReg - Add an LLVM value that is to be used as a register...x
+ /// addReg - Add an LLVM value that is to be used as a register...
///
MachineInstrBuilder &addReg(Value *V, bool isDef = false, bool isDNU = false){
MI->addRegOperand(V, isDef, isDNU);
return *this;
}
+ /// addClobber - Assert that this MI is going to clobber a specific
+ /// register. Useful for instructions that always clobber certain hard regs.
+ /// (Same as addReg(RegNo, true) but shorter and more obvious).
+ ///
+ MachineInstrBuilder &addClobber(int RegNo) {
+ MI->addRegOperand(RegNo, true);
+ return *this;
+ }
+
/// addPCDisp - Add an LLVM value to be treated as a PC relative
/// displacement...
///