[PATCH] Use lowercase version of argv[0] when determining driver mode
Reid Kleckner
rnk at google.com
Tue Aug 20 14:26:46 PDT 2013
On Tue, Aug 20, 2013 at 2:04 PM, Hans Wennborg <hans at chromium.org> wrote:
> Hi whunt,
>
> This makes a difference on Windows, where e.g. clang-cl might actually be
> called as CLANG-CL.
>
> http://llvm-reviews.chandlerc.com/D1450
>
> Files:
> tools/driver/driver.cpp
>
> Index: tools/driver/driver.cpp
> ===================================================================
> --- tools/driver/driver.cpp
> +++ tools/driver/driver.cpp
> @@ -226,6 +226,8 @@
> { "++", "--driver-mode=g++" },
> };
> std::string ProgName(llvm::sys::path::stem(ArgVector[0]));
> + for (size_t i = 0, e = ProgName.length(); i != e; ++i)
> + ProgName[i] = toLowercase(ProgName[i]);
>
This is modern C++, we can't use for loops, what are we, farmers!?
std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(),
::toLowerCase);
;)
Also, should we do this transform on non-Windows platforms?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130820/d73865c1/attachment.html>
More information about the cfe-commits
mailing list