This is an archive of the discontinued LLVM Phabricator instance.

Fix documentation of MachineInstr::getNumOperands
ClosedPublic

Authored by philipginsbach on Jul 17 2017, 5:40 AM.

Details

Summary

The current documentation states "Access to explicit operands of the instruction."
This is misleading, as it also lists implicit operands:

const_mop_iterator operands_end() const { return Operands + NumOperands; }

iterator_range<mop_iterator> implicit_operands() {
  return make_range(explicit_operands().end(), operands_end());
}

Diff Detail

Repository
rL LLVM

Event Timeline

philipginsbach created this revision.Jul 17 2017, 5:40 AM

Good catch!

include/llvm/CodeGen/MachineInstr.h
281 ↗(On Diff #106855)

I believe a comment like this would be more readable.

/// \retuns the total number of operands.

philipginsbach updated this revision to Diff 168786.EditedOct 9 2018, 6:08 AM

Rebased to current llvm master branch. Quentin, I have worked in your suggestion.

This revision is now accepted and ready to land.Oct 9 2018, 8:51 AM
This revision was automatically updated to reflect the committed changes.