[llvm] 29cb9dc - NFC: Run clang-format over llvm-link.
Nick Lewycky via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 28 14:33:18 PDT 2021
Author: Nick Lewycky
Date: 2021-04-28T14:33:00-07:00
New Revision: 29cb9dc4be257fd3afd8245fa421f0716feda5bd
URL: https://github.com/llvm/llvm-project/commit/29cb9dc4be257fd3afd8245fa421f0716feda5bd
DIFF: https://github.com/llvm/llvm-project/commit/29cb9dc4be257fd3afd8245fa421f0716feda5bd.diff
LOG: NFC: Run clang-format over llvm-link.
Added:
Modified:
llvm/tools/llvm-link/llvm-link.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index dde82382384a5..871b7265e32f9 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/tools/llvm-link/llvm-link.cpp
@@ -41,9 +41,8 @@
#include <utility>
using namespace llvm;
-static cl::list<std::string>
-InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bitcode files>"));
+static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
+ cl::desc("<input bitcode files>"));
static cl::list<std::string> OverridingInputs(
"override", cl::ZeroOrMore, cl::value_desc("filename"),
@@ -66,39 +65,38 @@ static cl::opt<std::string>
SummaryIndex("summary-index", cl::desc("Module summary index filename"),
cl::init(""), cl::value_desc("filename"));
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
- cl::value_desc("filename"));
+static cl::opt<std::string> OutputFilename("o",
+ cl::desc("Override output filename"),
+ cl::init("-"),
+ cl::value_desc("filename"));
-static cl::opt<bool>
-Internalize("internalize", cl::desc("Internalize linked symbols"));
+static cl::opt<bool> Internalize("internalize",
+ cl::desc("Internalize linked symbols"));
static cl::opt<bool>
DisableDITypeMap("disable-debug-info-type-map",
cl::desc("Don't use a uniquing type map for debug info"));
-static cl::opt<bool>
-OnlyNeeded("only-needed", cl::desc("Link only needed symbols"));
+static cl::opt<bool> OnlyNeeded("only-needed",
+ cl::desc("Link only needed symbols"));
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
+static cl::opt<bool> Force("f", cl::desc("Enable binary output on terminals"));
-static cl::opt<bool>
- DisableLazyLoad("disable-lazy-loading",
- cl::desc("Disable lazy module loading"));
+static cl::opt<bool> DisableLazyLoad("disable-lazy-loading",
+ cl::desc("Disable lazy module loading"));
static cl::opt<bool>
OutputAssembly("S", cl::desc("Write output as LLVM assembly"), cl::Hidden);
-static cl::opt<bool>
-Verbose("v", cl::desc("Print information about actions taken"));
+static cl::opt<bool> Verbose("v",
+ cl::desc("Print information about actions taken"));
-static cl::opt<bool>
-DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
+static cl::opt<bool> DumpAsm("d", cl::desc("Print assembly as linked"),
+ cl::Hidden);
-static cl::opt<bool>
-SuppressWarnings("suppress-warnings", cl::desc("Suppress all linking warnings"),
- cl::init(false));
+static cl::opt<bool> SuppressWarnings("suppress-warnings",
+ cl::desc("Suppress all linking warnings"),
+ cl::init(false));
static cl::opt<bool> PreserveBitcodeUseListOrder(
"preserve-bc-uselistorder",
@@ -161,9 +159,8 @@ static std::unique_ptr<Module> loadArFile(const char *Argv0,
Expected<StringRef> Ename = C.getName();
if (Error E = Ename.takeError()) {
errs() << Argv0 << ": ";
- WithColor::error()
- << " failed to read name of archive member"
- << ArchiveName << "'\n";
+ WithColor::error() << " failed to read name of archive member"
+ << ArchiveName << "'\n";
return nullptr;
}
std::string ChildName = Ename.get().str();
@@ -180,10 +177,10 @@ static std::unique_ptr<Module> loadArFile(const char *Argv0,
return nullptr;
};
- if (!isBitcode(reinterpret_cast<const unsigned char *>
- (MemBuf.get().getBufferStart()),
- reinterpret_cast<const unsigned char *>
- (MemBuf.get().getBufferEnd()))) {
+ if (!isBitcode(reinterpret_cast<const unsigned char *>(
+ MemBuf.get().getBufferStart()),
+ reinterpret_cast<const unsigned char *>(
+ MemBuf.get().getBufferEnd()))) {
errs() << Argv0 << ": ";
WithColor::error() << " member of archive is not a bitcode file: '"
<< ChildName << "'\n";
@@ -281,7 +278,7 @@ struct LLVMLinkDiagnosticHandler : public DiagnosticHandler {
return true;
}
};
-}
+} // namespace
/// Import any functions requested via the -import option.
static bool importFunctions(const char *argv0, Module &DestModule) {
@@ -352,8 +349,7 @@ static bool importFunctions(const char *argv0, Module &DestModule) {
}
static bool linkFiles(const char *argv0, LLVMContext &Context, Linker &L,
- const cl::list<std::string> &Files,
- unsigned Flags) {
+ const cl::list<std::string> &Files, unsigned Flags) {
// Filter out flags that don't apply to the first file we load.
unsigned ApplicableFlags = Flags & Linker::Flags::OverrideFromSrc;
// Similar to some flags, internalization doesn't apply to the first file.
@@ -436,8 +432,8 @@ int main(int argc, char **argv) {
ExitOnErr.setBanner(std::string(argv[0]) + ": ");
LLVMContext Context;
- Context.setDiagnosticHandler(
- std::make_unique<LLVMLinkDiagnosticHandler>(), true);
+ Context.setDiagnosticHandler(std::make_unique<LLVMLinkDiagnosticHandler>(),
+ true);
cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
if (!DisableDITypeMap)
More information about the llvm-commits
mailing list