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()).

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

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.