This is an archive of the discontinued LLVM Phabricator instance.

ArrayRef-ize ValueObject
ClosedPublic

Authored by lhames on Apr 25 2017, 6:14 PM.

Details

Reviewers
jingham
Summary

Using llvm::ArrayRef rather than std::vector/initializer_list allows us to remove some overloads, avoid some temporary copies, and allows these methods to work with all array-like types.

The only drawback is that initializer lists of exactly two elements become ambiguous for GetChildAtIndexPath, since they could be an array of two size_ts, or a singleton pair of a size_t and a bool. In practice this only requires disambiguation at a single call-site in all of LLDB, so it seems like a decent trade-off.

Diff Detail

Repository
rL LLVM

Event Timeline

lhames created this revision.Apr 25 2017, 6:14 PM
jingham accepted this revision.Apr 26 2017, 10:49 AM

That seems fine: the compiler will keep you from making a mistake, and the two element syntax is not terribly onerous.

This revision is now accepted and ready to land.Apr 26 2017, 10:49 AM
lhames closed this revision.Apr 26 2017, 11:29 AM

Thanks Jim.

Landed in r301441.