aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2023-09-21 13:16:11 +0200
committerTobias Hieta <tobias@hieta.se>2023-10-02 18:12:54 +0200
commit71be0aafe357e2a9a40ed0628a21ccbe0a6b8813 (patch)
treeff7ac7d9f43c898f37afad82642563ed38ca55b5
parent[compiler-rt] Reinstate removal of CRT choice flags from CMAKE_*_FLAGS* (#67935) (diff)
downloadllvm-project-71be0aafe357e2a9a40ed0628a21ccbe0a6b8813.tar.gz
llvm-project-71be0aafe357e2a9a40ed0628a21ccbe0a6b8813.tar.bz2
llvm-project-71be0aafe357e2a9a40ed0628a21ccbe0a6b8813.zip
[NFC] clang-format lld/COFF/Driver.cpp and lld/Common/Filesystem.cpp
In order to reduce noise for a MR. (cherry picked from commit a5e280bc6bda10607e0e7c864e4d23fac02d00aa)
-rw-r--r--lld/COFF/Driver.cpp32
-rw-r--r--lld/Common/Filesystem.cpp2
2 files changed, 18 insertions, 16 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index d7476e91e03e..61a04a74aa60 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -342,8 +342,8 @@ void LinkerDriver::enqueueArchiveMember(const Archive::Child &c,
CHECK(c.getFullName(),
"could not get the filename for the member defining symbol " +
toCOFFString(ctx, sym));
- auto future = std::make_shared<std::future<MBErrPair>>(
- createFutureForFile(childName));
+ auto future =
+ std::make_shared<std::future<MBErrPair>>(createFutureForFile(childName));
enqueueTask([=]() {
auto mbOrErr = future->get();
if (mbOrErr.second)
@@ -640,26 +640,28 @@ void LinkerDriver::detectWinSysRoot(const opt::InputArgList &Args) {
void LinkerDriver::addClangLibSearchPaths(const std::string &argv0) {
std::string lldBinary = sys::fs::getMainExecutable(argv0.c_str(), nullptr);
SmallString<128> binDir(lldBinary);
- sys::path::remove_filename(binDir); // remove lld-link.exe
+ sys::path::remove_filename(binDir); // remove lld-link.exe
StringRef rootDir = sys::path::parent_path(binDir); // remove 'bin'
SmallString<128> libDir(rootDir);
sys::path::append(libDir, "lib");
// We need to prepend the paths here in order to make sure that we always
- // try to link the clang versions of the builtins over the ones supplied by MSVC.
+ // try to link the clang versions of the builtins over the ones supplied by
+ // MSVC.
searchPaths.insert(searchPaths.begin(), saver().save(libDir.str()));
// Add the resource dir library path
SmallString<128> runtimeLibDir(rootDir);
- sys::path::append(runtimeLibDir, "lib", "clang", std::to_string(LLVM_VERSION_MAJOR), "lib");
+ sys::path::append(runtimeLibDir, "lib", "clang",
+ std::to_string(LLVM_VERSION_MAJOR), "lib");
searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDir.str()));
// Resource dir + osname, which is hardcoded to windows since we are in the
// COFF driver.
SmallString<128> runtimeLibDirWithOS(runtimeLibDir);
sys::path::append(runtimeLibDirWithOS, "windows");
- searchPaths.insert(searchPaths.begin(), saver().save(runtimeLibDirWithOS.str()));
-
+ searchPaths.insert(searchPaths.begin(),
+ saver().save(runtimeLibDirWithOS.str()));
}
void LinkerDriver::addWinSysRootLibSearchPaths() {
@@ -1145,8 +1147,7 @@ void LinkerDriver::parseOrderFile(StringRef arg) {
if (set.count(s) == 0) {
if (ctx.config.warnMissingOrderSymbol)
warn("/order:" + arg + ": missing symbol: " + s + " [LNK4037]");
- }
- else
+ } else
ctx.config.order[s] = INT_MIN + ctx.config.order.size();
}
@@ -1313,8 +1314,8 @@ void LinkerDriver::parsePDBAltPath() {
else if (var.equals_insensitive("%_ext%"))
buf.append(binaryExtension);
else {
- warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " +
- var + " as literal");
+ warn("only %_PDB% and %_EXT% supported in /pdbaltpath:, keeping " + var +
+ " as literal");
buf.append(var);
}
@@ -1448,8 +1449,8 @@ getVFS(const opt::InputArgList &args) {
return nullptr;
}
- if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr), /*DiagHandler*/ nullptr,
- arg->getValue()))
+ if (auto ret = vfs::getVFSFromYAML(std::move(*bufOrErr),
+ /*DiagHandler*/ nullptr, arg->getValue()))
return ret;
error("Invalid vfs overlay");
@@ -2101,7 +2102,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
// Handle /RELEASE
if (args.hasArg(OPT_release))
config->writeCheckSum = true;
-
+
// Handle /safeseh, x86 only, on by default, except for mingw.
if (config->machine == I386) {
config->safeSEH = args.hasFlag(OPT_safeseh, OPT_safeseh_no, !config->mingw);
@@ -2342,7 +2343,8 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
std::vector<WrappedSymbol> wrapped = addWrappedSymbols(ctx, args);
// Load more object files that might be needed for wrapped symbols.
if (!wrapped.empty())
- while (run());
+ while (run())
+ ;
if (config->autoImport || config->stdcallFixup) {
// MinGW specific.
diff --git a/lld/Common/Filesystem.cpp b/lld/Common/Filesystem.cpp
index 671b352a3f6b..c93353f2d292 100644
--- a/lld/Common/Filesystem.cpp
+++ b/lld/Common/Filesystem.cpp
@@ -57,7 +57,7 @@ void lld::unlinkAsync(StringRef path) {
//
// The code here allows LLD to work on all versions of Windows.
// However, at Windows 10 1903 it seems that the behavior of
- // Windows has changed, so that we could simply delete the output
+ // Windows has changed, so that we could simply delete the output
// file. This code should be simplified once support for older
// versions of Windows is dropped.
//