[PATCH] D35152: Add some basic linker module symbols
Zachary Turner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 10 14:01:04 PDT 2017
zturner added inline comments.
================
Comment at: lld/COFF/Driver.cpp:59
Config = make<Configuration>();
+ Config->Argv.assign(Args.begin(), Args.end());
Config->ColorDiagnostics =
----------------
ruiu wrote:
> I honestly didn't know that std::vector has `assign` member function. Does
>
> Config->Argv = {Args.begin(), Args.end()};
>
> work too? If so, I prefer this way.
Yes, that works. In general `assign` is more efficient because it uses already reserved storage. In this case it doesn't matter since we're actually just initializing it. But say for example you have a `vector` with 1000 items in it, in that case `assign()` would be better since it wouldn't free the internal buffer. In any case, I've made the change you suggested and will submit like that.
https://reviews.llvm.org/D35152
More information about the llvm-commits
mailing list