Skip to content

Commit 1ad2462

Browse files
committed
Address review comments.
1 parent fe05eed commit 1ad2462

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

lib/Driver/Driver.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,21 +212,19 @@ makeToolChain(Driver &driver, const llvm::Triple &target) {
212212
return llvm::make_unique<toolchains::Darwin>(driver, target);
213213
break;
214214
case llvm::Triple::Linux:
215-
if (target.isAndroid()) {
215+
if (target.isAndroid())
216216
return llvm::make_unique<toolchains::Android>(driver, target);
217-
} else {
217+
else
218218
return llvm::make_unique<toolchains::GenericUnix>(driver, target);
219-
}
220219
break;
221220
case llvm::Triple::FreeBSD:
222221
return llvm::make_unique<toolchains::GenericUnix>(driver, target);
223222
break;
224223
case llvm::Triple::Win32:
225-
if (target.isWindowsCygwinEnvironment()) {
224+
if (target.isWindowsCygwinEnvironment())
226225
return llvm::make_unique<toolchains::Cygwin>(driver, target);
227-
} else {
226+
else
228227
return llvm::make_unique<toolchains::Windows>(driver, target);
229-
}
230228
break;
231229
case llvm::Triple::Haiku:
232230
return llvm::make_unique<toolchains::GenericUnix>(driver, target);

lib/Driver/ToolChains.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ getSanitizerRuntimeLibNameForDarwin(StringRef Sanitizer,
11141114
}
11151115

11161116
static std::string getSanitizerRuntimeLibNameForWindows(
1117-
StringRef Sanitizer, const llvm::Triple &Triple, bool shared = true) {
1117+
StringRef Sanitizer, const llvm::Triple &Triple) {
11181118
return (Twine("clang_rt.") + Sanitizer + "-" + Triple.getArchName() + ".lib")
11191119
.str();
11201120
}
@@ -1225,14 +1225,10 @@ addLinkSanitizerLibArgsForDarwin(const ArgList &Args,
12251225
static void addLinkSanitizerLibArgsForWindows(const ArgList &Args,
12261226
ArgStringList &Arguments,
12271227
StringRef Sanitizer,
1228-
const ToolChain &TC,
1229-
bool shared = true) {
1230-
// Sanitizer runtime libraries requires C++.
1231-
Arguments.push_back("-lc++");
1232-
1228+
const ToolChain &TC) {
12331229
addLinkRuntimeLibForWindows(
12341230
Args, Arguments,
1235-
getSanitizerRuntimeLibNameForWindows(Sanitizer, TC.getTriple(), shared),
1231+
getSanitizerRuntimeLibNameForWindows(Sanitizer, TC.getTriple()),
12361232
TC);
12371233
}
12381234

@@ -1571,16 +1567,10 @@ toolchains::Windows::constructInvocation(const LinkJobAction &job,
15711567
Arguments.push_back(context.Args.MakeArgString(Target));
15721568
}
15731569

1574-
bool staticExecutable = false;
1575-
bool staticStdlib = false;
1576-
1577-
if (context.Args.hasFlag(options::OPT_static_executable,
1578-
options::OPT_no_static_executable, false)) {
1579-
staticExecutable = true;
1580-
} else if (context.Args.hasFlag(options::OPT_static_stdlib,
1581-
options::OPT_no_static_stdlib, false)) {
1582-
staticStdlib = true;
1583-
}
1570+
bool staticExecutable = context.Args.hasFlag(
1571+
options::OPT_static_executable, options::OPT_no_static_executable, false);
1572+
bool staticStdlib = context.Args.hasFlag(
1573+
options::OPT_static_stdlib, options::OPT_no_static_stdlib, false);
15841574

15851575
SmallString<128> SharedRuntimeLibPath;
15861576
getRuntimeLibraryPath(SharedRuntimeLibPath, context.Args, *this);

0 commit comments

Comments
 (0)