[lld] r366177 - Fix parameter name comments using clang-tidy. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 21:46:32 PDT 2019
Author: ruiu
Date: Mon Jul 15 21:46:31 2019
New Revision: 366177
URL: http://llvm.org/viewvc/llvm-project?rev=366177&view=rev
Log:
Fix parameter name comments using clang-tidy. NFC.
This patch applies clang-tidy's bugprone-argument-comment tool
to LLVM, clang and lld source trees. Here is how I created this
patch:
$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm-project
$ mkdir build
$ cd build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \
-DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm
$ ninja
$ parallel clang-tidy -checks='-*,bugprone-argument-comment' \
-config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \
::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h}
Modified:
lld/trunk/COFF/Driver.cpp
lld/trunk/COFF/DriverUtils.cpp
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/InputFiles.cpp
lld/trunk/ELF/ScriptParser.cpp
lld/trunk/ELF/Thunks.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=366177&r1=366176&r2=366177&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Mon Jul 15 21:46:31 2019
@@ -1606,7 +1606,7 @@ void LinkerDriver::link(ArrayRef<const c
// Handle generation of import library from a def file.
if (!args.hasArg(OPT_INPUT)) {
fixupExports();
- createImportLibrary(/*AsLib=*/true);
+ createImportLibrary(/*asLib=*/true);
return;
}
@@ -1830,7 +1830,7 @@ void LinkerDriver::link(ArrayRef<const c
// need to create a .lib file.
if (!config->exports.empty() || config->dll) {
fixupExports();
- createImportLibrary(/*AsLib=*/false);
+ createImportLibrary(/*asLib=*/false);
assignExportOrdinals();
}
Modified: lld/trunk/COFF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/DriverUtils.cpp?rev=366177&r1=366176&r2=366177&view=diff
==============================================================================
--- lld/trunk/COFF/DriverUtils.cpp (original)
+++ lld/trunk/COFF/DriverUtils.cpp Mon Jul 15 21:46:31 2019
@@ -348,7 +348,7 @@ public:
// IsVolatileSize=true forces MemoryBuffer to not use mmap().
return CHECK(MemoryBuffer::getFile(path, /*FileSize=*/-1,
/*RequiresNullTerminator=*/false,
- /*IsVolatileSize=*/true),
+ /*IsVolatile=*/true),
"could not open " + path);
}
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=366177&r1=366176&r2=366177&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon Jul 15 21:46:31 2019
@@ -272,7 +272,7 @@ void LinkerDriver::addFile(StringRef pat
// Add a given library by searching it from input search paths.
void LinkerDriver::addLibrary(StringRef name) {
if (Optional<std::string> path = searchLibrary(name))
- addFile(*path, /*WithLOption=*/true);
+ addFile(*path, /*withLOption=*/true);
else
error("unable to find library -l" + name);
}
@@ -1118,7 +1118,7 @@ void LinkerDriver::createFiles(opt::Inpu
addLibrary(arg->getValue());
break;
case OPT_INPUT:
- addFile(arg->getValue(), /*WithLOption=*/false);
+ addFile(arg->getValue(), /*withLOption=*/false);
break;
case OPT_defsym: {
StringRef from;
@@ -1386,7 +1386,7 @@ static void replaceCommonSymbols() {
bss->markDead();
inputSections.push_back(bss);
s->replace(Defined{s->file, s->getName(), s->binding, s->stOther, s->type,
- /*Value=*/0, s->size, bss});
+ /*value=*/0, s->size, bss});
});
}
@@ -1540,7 +1540,7 @@ template <class ELFT> void LinkerDriver:
for (InputFile *file : lto->compile()) {
auto *obj = cast<ObjFile<ELFT>>(file);
- obj->parse(/*IgnoreComdats=*/true);
+ obj->parse(/*ignoreComdats=*/true);
for (Symbol *sym : obj->getGlobalSymbols())
sym->parseSymbolVersion();
objectFiles.push_back(file);
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=366177&r1=366176&r2=366177&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon Jul 15 21:46:31 2019
@@ -552,11 +552,11 @@ static void addDependentLibrary(StringRe
if (!config->dependentLibraries)
return;
if (fs::exists(specifier))
- driver->addFile(specifier, /*WithLOption=*/false);
+ driver->addFile(specifier, /*withLOption=*/false);
else if (Optional<std::string> s = findFromSearchPaths(specifier))
- driver->addFile(*s, /*WithLOption=*/true);
+ driver->addFile(*s, /*withLOption=*/true);
else if (Optional<std::string> s = searchLibraryBaseName(specifier))
- driver->addFile(*s, /*WithLOption=*/true);
+ driver->addFile(*s, /*withLOption=*/true);
else
error(toString(f) +
": unable to find library from dependent library specifier: " +
Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=366177&r1=366176&r2=366177&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Mon Jul 15 21:46:31 2019
@@ -280,26 +280,26 @@ void ScriptParser::addFile(StringRef s)
SmallString<128> pathData;
StringRef path = (config->sysroot + s).toStringRef(pathData);
if (sys::fs::exists(path)) {
- driver->addFile(saver.save(path), /*WithLOption=*/false);
+ driver->addFile(saver.save(path), /*withLOption=*/false);
return;
}
}
if (s.startswith("/")) {
- driver->addFile(s, /*WithLOption=*/false);
+ driver->addFile(s, /*withLOption=*/false);
} else if (s.startswith("=")) {
if (config->sysroot.empty())
- driver->addFile(s.substr(1), /*WithLOption=*/false);
+ driver->addFile(s.substr(1), /*withLOption=*/false);
else
driver->addFile(saver.save(config->sysroot + "/" + s.substr(1)),
- /*WithLOption=*/false);
+ /*withLOption=*/false);
} else if (s.startswith("-l")) {
driver->addLibrary(s.substr(2));
} else if (sys::fs::exists(s)) {
- driver->addFile(s, /*WithLOption=*/false);
+ driver->addFile(s, /*withLOption=*/false);
} else {
if (Optional<std::string> path = findFromSearchPaths(s))
- driver->addFile(saver.save(*path), /*WithLOption=*/true);
+ driver->addFile(saver.save(*path), /*withLOption=*/true);
else
setError("unable to find " + s);
}
Modified: lld/trunk/ELF/Thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Thunks.cpp?rev=366177&r1=366176&r2=366177&view=diff
==============================================================================
--- lld/trunk/ELF/Thunks.cpp (original)
+++ lld/trunk/ELF/Thunks.cpp Mon Jul 15 21:46:31 2019
@@ -319,7 +319,7 @@ public:
Defined *Thunk::addSymbol(StringRef name, uint8_t type, uint64_t value,
InputSectionBase §ion) {
- Defined *d = addSyntheticLocal(name, type, value, /*Size=*/0, section);
+ Defined *d = addSyntheticLocal(name, type, value, /*size=*/0, section);
syms.push_back(d);
return d;
}
More information about the llvm-commits
mailing list