diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-14 19:56:11 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-14 19:56:11 +0000 |
commit | ca82c85029ae0befb17bc14a4faa9f3d51dd72b3 (patch) | |
tree | 2df9dea922feef454abe6d1499112a4abc270079 /gnu/llvm/tools/llvm-as | |
parent | 04c0d479b956b5e4f4e20ce989b95443aa03da0b (diff) |
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/tools/llvm-as')
-rw-r--r-- | gnu/llvm/tools/llvm-as/llvm-as.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/gnu/llvm/tools/llvm-as/llvm-as.cpp b/gnu/llvm/tools/llvm-as/llvm-as.cpp index d4e4d8d7107..89a6ee5edfd 100644 --- a/gnu/llvm/tools/llvm-as/llvm-as.cpp +++ b/gnu/llvm/tools/llvm-as/llvm-as.cpp @@ -15,9 +15,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IR/LLVMContext.h" #include "llvm/AsmParser/Parser.h" #include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/Verifier.h" #include "llvm/Support/CommandLine.h" @@ -31,29 +31,28 @@ #include <memory> using namespace llvm; -static cl::opt<std::string> -InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-")); +static cl::opt<std::string> InputFilename(cl::Positional, + cl::desc("<input .llvm file>"), + cl::init("-")); -static cl::opt<std::string> -OutputFilename("o", cl::desc("Override output filename"), - cl::value_desc("filename")); +static cl::opt<std::string> OutputFilename("o", + cl::desc("Override output filename"), + cl::value_desc("filename")); -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> -DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false)); +static cl::opt<bool> DisableOutput("disable-output", cl::desc("Disable output"), + cl::init(false)); -static cl::opt<bool> -EmitFunctionSummary("function-summary", cl::desc("Emit function summary index"), - cl::init(false)); +static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"), + cl::init(false)); -static cl::opt<bool> -DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden); +static cl::opt<bool> DumpAsm("d", cl::desc("Print assembly as parsed"), + cl::Hidden); static cl::opt<bool> -DisableVerify("disable-verify", cl::Hidden, - cl::desc("Do not run verifier on input LLVM (dangerous!)")); + DisableVerify("disable-verify", cl::Hidden, + cl::desc("Do not run verifier on input LLVM (dangerous!)")); static cl::opt<bool> PreserveBitcodeUseListOrder( "preserve-bc-uselistorder", @@ -81,8 +80,8 @@ static void WriteOutputFile(const Module *M) { } if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) - WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder, - EmitFunctionSummary); + WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder, nullptr, + EmitModuleHash); // Declare success. Out->keep(); @@ -90,10 +89,10 @@ static void WriteOutputFile(const Module *M) { int main(int argc, char **argv) { // Print a stack trace if we signal out. - sys::PrintStackTraceOnErrorSignal(); + sys::PrintStackTraceOnErrorSignal(argv[0]); PrettyStackTraceProgram X(argc, argv); - LLVMContext &Context = getGlobalContext(); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. + LLVMContext Context; + llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n"); // Parse the file now... @@ -115,7 +114,8 @@ int main(int argc, char **argv) { } } - if (DumpAsm) errs() << "Here's the assembly:\n" << *M.get(); + if (DumpAsm) + errs() << "Here's the assembly:\n" << *M.get(); if (!DisableOutput) WriteOutputFile(M.get()); |