Skip to content

Commit a5e280b

Browse files
committed
[NFC] clang-format lld/COFF/Driver.cpp and lld/Common/Filesystem.cpp
In order to reduce noise for a MR.
1 parent 12d1476 commit a5e280b

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

lld/COFF/Driver.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
342342
CHECK(c.getFullName(),
343343
"could not get the filename for the member defining symbol " +
344344
toCOFFString(ctx, sym));
345-
auto future = std::make_shared<std::future<MBErrPair>>(
346-
createFutureForFile(childName));
345+
auto future =
346+
std::make_shared<std::future<MBErrPair>>(createFutureForFile(childName));
347347
enqueueTask([=]() {
348348
auto mbOrErr = future->get();
349349
if (mbOrErr.second)
@@ -640,26 +640,28 @@ void LinkerDriver::detectWinSysRoot(const opt::InputArgList &Args) {
640640
void LinkerDriver::addClangLibSearchPaths(const std::string &argv0) {
641641
std::string lldBinary = sys::fs::getMainExecutable(argv0.c_str(), nullptr);
642642
SmallString<128> binDir(lldBinary);
643-
sys::path::remove_filename(binDir); // remove lld-link.exe
643+
sys::path::remove_filename(binDir); // remove lld-link.exe
644644
StringRef rootDir = sys::path::parent_path(binDir); // remove 'bin'
645645

646646
SmallString<128> libDir(rootDir);
647647
sys::path::append(libDir, "lib");
648648
// We need to prepend the paths here in order to make sure that we always
649-
// try to link the clang versions of the builtins over the ones supplied by MSVC.
649+
// try to link the clang versions of the builtins over the ones supplied by
650+
// MSVC.
650651
searchPaths.insert(searchPaths.begin(), saver().save(libDir.str()));
651652

652653
// Add the resource dir library path
653654
SmallString<128> runtimeLibDir(rootDir);
654-
sys::path::append(runtimeLibDir, "lib", "clang", std::to_string(LLVM_VERSION_MAJOR), "lib");
655+
sys::path::append(runtimeLibDir, "lib", "clang",
656+
std::to_string(LLVM_VERSION_MAJOR), "lib");
655657
searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDir.str()));
656658

657659
// Resource dir + osname, which is hardcoded to windows since we are in the
658660
// COFF driver.
659661
SmallString<128> runtimeLibDirWithOS(runtimeLibDir);
660662
sys::path::append(runtimeLibDirWithOS, "windows");
661-
searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDirWithOS.str()));
662-
663+
searchPaths.insert(searchPaths.begin(),
664+
saver().save(runtimeLibDirWithOS.str()));
663665
}
664666

665667
void LinkerDriver::addWinSysRootLibSearchPaths() {
@@ -1145,8 +1147,7 @@ void LinkerDriver::parseOrderFile(StringRef arg) {
11451147
if (set.count(s) == 0) {
11461148
if (ctx.config.warnMissingOrderSymbol)
11471149
warn("/order:" + arg + ": missing symbol: " + s + " [LNK4037]");
1148-
}
1149-
else
1150+
} else
11501151
ctx.config.order[s] = INT_MIN + ctx.config.order.size();
11511152
}
11521153

@@ -1313,8 +1314,8 @@ void LinkerDriver::parsePDBAltPath() {
13131314
else if (var.equals_insensitive("%_ext%"))
13141315
buf.append(binaryExtension);
13151316
else {
1316-
warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " +
1317-
var + " as literal");
1317+
warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " + var +
1318+
" as literal");
13181319
buf.append(var);
13191320
}
13201321

@@ -1448,8 +1449,8 @@ getVFS(const opt::InputArgList &args) {
14481449
return nullptr;
14491450
}
14501451

1451-
if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr), /*DiagHandler*/ nullptr,
1452-
arg->getValue()))
1452+
if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr),
1453+
/*DiagHandler*/ nullptr, arg->getValue()))
14531454
return ret;
14541455

14551456
error("Invalid vfs overlay");
@@ -2101,7 +2102,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
21012102
// Handle /RELEASE
21022103
if (args.hasArg(OPT_release))
21032104
config->writeCheckSum = true;
2104-
2105+
21052106
// Handle /safeseh, x86 only, on by default, except for mingw.
21062107
if (config->machine == I386) {
21072108
config->safeSEH = args.hasFlag(OPT_safeseh, OPT_safeseh_no, !config->mingw);
@@ -2342,7 +2343,8 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
23422343
std::vector<WrappedSymbol> wrapped = addWrappedSymbols(ctx, args);
23432344
// Load more object files that might be needed for wrapped symbols.
23442345
if (!wrapped.empty())
2345-
while (run());
2346+
while (run())
2347+
;
23462348

23472349
if (config->autoImport || config->stdcallFixup) {
23482350
// MinGW specific.

lld/Common/Filesystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void lld::unlinkAsync(StringRef path) {
5757
//
5858
// The code here allows LLD to work on all versions of Windows.
5959
// However, at Windows 10 1903 it seems that the behavior of
60-
// Windows has changed, so that we could simply delete the output
60+
// Windows has changed, so that we could simply delete the output
6161
// file. This code should be simplified once support for older
6262
// versions of Windows is dropped.
6363
//

0 commit comments

Comments
 (0)