From: Matthias Braun Date: Thu, 16 Jul 2015 20:27:01 +0000 (+0000) Subject: MachineInstr: Explain the subtle semantics of uses()/defs() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=da787addf3738669c8c8a5687523d56dcf4bb304;p=oota-llvm.git MachineInstr: Explain the subtle semantics of uses()/defs() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242438 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index de7e0a29ea0..be0b629a697 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -314,18 +314,24 @@ public: return iterator_range(explicit_operands().end(), operands_end()); } + /// Returns a range over all explicit operands that are register definitions. + /// Implicit definition are not included! iterator_range defs() { return iterator_range( operands_begin(), operands_begin() + getDesc().getNumDefs()); } + /// \copydoc defs() iterator_range defs() const { return iterator_range( 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 uses() { return iterator_range( operands_begin() + getDesc().getNumDefs(), operands_end()); } + /// \copydoc uses() iterator_range uses() const { return iterator_range( operands_begin() + getDesc().getNumDefs(), operands_end());