mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
NFC: Run clang-format over llvm-link.
This commit is contained in:
parent
2c0197c261
commit
17b3534ddd
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user