This is an archive of the discontinued LLVM Phabricator instance.

Remove getArgumentList() in favor of arg_begin(), args(), etc
ClosedPublic

Authored by rnk on Mar 16 2017, 1:22 PM.

Details

Summary

Users often call getArgumentList().size(), which is a linear way to get
the number of function arguments. arg_size(), on the other hand, is
constant time.

In general, the fact that arguments are stored in an iplist is an
implementation detail, so I've removed it from the Function interface
and moved all other users to the argument container APIs (arg_begin(),
arg_end(), args(), arg_size()).

Diff Detail

Repository
rL LLVM

Event Timeline

rnk created this revision.Mar 16 2017, 1:22 PM
chandlerc accepted this revision.Mar 16 2017, 3:44 PM

LGTM once split.

include/llvm/IR/Argument.h
40–41 ↗(On Diff #92042)

This change seems unrelated, land separately? (Likely simple enough to be obvious.)

This revision is now accepted and ready to land.Mar 16 2017, 3:44 PM
This revision was automatically updated to reflect the committed changes.