MachineInstr: Explain the subtle semantics of uses()/defs()
authorMatthias Braun <matze@braunis.de>
Thu, 16 Jul 2015 20:27:01 +0000 (20:27 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 16 Jul 2015 20:27:01 +0000 (20:27 +0000)
llvm-svn: 242438

llvm/include/llvm/CodeGen/MachineInstr.h

index de7e0a2..be0b629 100644 (file)
@@ -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());