This option globalize the given symbol
You might as well get rid of this section, since you have no symbols in it.
Two points regarding this and the SymbolsToLocalize bit above, which I only just noticed:
empty() was not completely useless here imo - this flag is probably not the most frequently used flag, thus when it's not specified the "early check" would save us at least 3 function calls per symbol (at least in the debug builds) (std::begin/end/find)
|38 ↗||(On Diff #144301)|
if it's only used in llvm-objcopy.cpp - maybe move it there ? (and make it static to avoid putting it into the global namespace)
|39 ↗||(On Diff #144301)|
it seems to me, that the name Vector is kind of misleading here - this function (as is) is more generic - maybe replace Vector with Sequence or Container ? + change Elt to smth like X (but that's just an opinion, not super important)
I think this is a case of premature optimization. A standard library implementation of .empty() might easily just use the distance between the begin and end iterator, so might end up with just as many (potentially more) calls as saved. Similarly, an optimizer might be able to optimize the calls.
In other words: unless performance measurements show differently, I'd prefer to keep the code simpler.