[llvm] r242438 - MachineInstr: Explain the subtle semantics of uses()/defs()
Matthias Braun
matze at braunis.de
Thu Jul 16 13:27:02 PDT 2015
Author: matze
Date: Thu Jul 16 15:27:01 2015
New Revision: 242438
URL: http://llvm.org/viewvc/llvm-project?rev=242438&view=rev
Log:
MachineInstr: Explain the subtle semantics of uses()/defs()
Modified:
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=242438&r1=242437&r2=242438&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Thu Jul 16 15:27:01 2015
@@ -314,18 +314,24 @@ public:
return iterator_range<const_mop_iterator>(explicit_operands().end(),
operands_end());
}
+ /// Returns a range over all explicit operands that are register definitions.
+ /// Implicit definition are not included!
iterator_range<mop_iterator> defs() {
return iterator_range<mop_iterator>(
operands_begin(), operands_begin() + getDesc().getNumDefs());
}
+ /// \copydoc defs()
iterator_range<const_mop_iterator> defs() const {
return iterator_range<const_mop_iterator>(
operands_begin(), operands_begin() + getDesc().getNumDefs());
}
+ /// Returns a range that includes all operands that are register uses.
+ /// This may include unrelated operands which are not register uses.
iterator_range<mop_iterator> uses() {
return iterator_range<mop_iterator>(
operands_begin() + getDesc().getNumDefs(), operands_end());
}
+ /// \copydoc uses()
iterator_range<const_mop_iterator> uses() const {
return iterator_range<const_mop_iterator>(
operands_begin() + getDesc().getNumDefs(), operands_end());
More information about the llvm-commits
mailing list