Skip to content

Commit 6e234e6

Browse files
committed
Driver: pass -target immediately after clang++
1 parent 4f98772 commit 6e234e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Driver/WindowsToolChains.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ toolchains::Windows::constructInvocation(const DynamicLinkJobAction &job,
5252

5353
ArgStringList Arguments;
5454

55+
std::string Target = getTriple().str();
56+
if (!Target.empty()) {
57+
Arguments.push_back("-target");
58+
Arguments.push_back(context.Args.MakeArgString(Target));
59+
}
60+
5561
switch (job.getKind()) {
5662
case LinkKind::None:
5763
llvm_unreachable("invalid link kind");
@@ -104,12 +110,6 @@ toolchains::Windows::constructInvocation(const DynamicLinkJobAction &job,
104110
Clang = context.Args.MakeArgString(tool.get());
105111
}
106112

107-
std::string Target = getTriple().str();
108-
if (!Target.empty()) {
109-
Arguments.push_back("-target");
110-
Arguments.push_back(context.Args.MakeArgString(Target));
111-
}
112-
113113
// Rely on `-libc` to correctly identify the MSVC Runtime Library. We use
114114
// `-nostartfiles` as that limits the difference to just the
115115
// `-defaultlib:libcmt` which is passed unconditionally with the `clang++`

0 commit comments

Comments
 (0)