[PATCH] Driver: Replace switch cases with ifs.

Chandler Carruth chandlerc at google.com
Mon Feb 9 16:36:44 PST 2015


On Mon, Feb 9, 2015 at 4:30 PM, Sean Silva <chisophugis at gmail.com> wrote:

> This probably makes sense for consistency with clang, but FYI with current
> libOption each of the "getLastArg" is linear in the command line length, so
> the previous switch version was actually much more efficient.
>
> This might be more problematic for LLD than for clang since linker command
> lines can sometimes end up being much longer than compiler command lines.
>
>  The right fix of course is for libOption to cache or otherwise avoid
> O(cmdline length) work per getLastArg.
>

Indeed. libOption should provide a fast lookup structure here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150209/db16d9f1/attachment.html>


More information about the llvm-commits mailing list