r225134 - Fix default image name to 'a.exe' on Windows, instead 'a.out'.

Hans Wennborg hans at chromium.org
Thu Jan 8 13:16:01 PST 2015


On Sun, Jan 4, 2015 at 5:48 AM, Yaron Keren <yaron.keren at gmail.com> wrote:
> Author: yrnkrn
> Date: Sun Jan  4 07:48:30 2015
> New Revision: 225134
>
> URL: http://llvm.org/viewvc/llvm-project?rev=225134&view=rev
> Log:
> Fix default image name to 'a.exe' on Windows, instead 'a.out'.
> This applies to mingw as clang-cl already has its own logic for the filename.

[..]

> Modified: cfe/trunk/lib/Driver/Driver.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=225134&r1=225133&r2=225134&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Driver.cpp (original)
> +++ cfe/trunk/lib/Driver/Driver.cpp Sun Jan  4 07:48:30 2015
> @@ -1996,6 +1996,8 @@ const ToolChain &Driver::getToolChain(co
>                                        StringRef DarwinArchName) const {
>    llvm::Triple Target = computeTargetTriple(DefaultTargetTriple, Args,
>                                              DarwinArchName);
> +  if (Target.isOSWindows())
> +    DefaultImageName = "a.exe";

This doesn't seem right. Why should getToolChain() be changing the
Driver's DefaultImageName? That this requires DefaultImageName to be
mutable makes it feel even more iffy.

Maybe DefaultImageName should be a property of the Target? Or perhaps
there should be a "const char *Driver::DefaultImageName(llvm::Triple)"
method?


> Modified: cfe/trunk/test/Driver/lto.c

It would be nice to test for the default image name explicitly by
setting -target and looking at the cc1 invocation.

 - Hans



More information about the cfe-commits mailing list