diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/tools/opt/opt.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/tools/opt/opt.cpp')
| -rw-r--r-- | gnu/llvm/tools/opt/opt.cpp | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/gnu/llvm/tools/opt/opt.cpp b/gnu/llvm/tools/opt/opt.cpp index 24cce58047f..c471e0f2e3e 100644 --- a/gnu/llvm/tools/opt/opt.cpp +++ b/gnu/llvm/tools/opt/opt.cpp @@ -23,7 +23,7 @@ #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Bitcode/BitcodeWriterPass.h" -#include "llvm/CodeGen/CommandFlags.h" +#include "llvm/CodeGen/CommandFlags.def" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DebugInfo.h" @@ -349,7 +349,7 @@ static TargetMachine* GetTargetMachine(Triple TheTriple, StringRef CPUStr, return TheTarget->createTargetMachine(TheTriple.getTriple(), CPUStr, FeaturesStr, Options, getRelocModel(), - CMModel, GetCodeGenOptLevel()); + getCodeModel(), GetCodeGenOptLevel()); } #ifdef LINK_POLLY_INTO_TOOLS @@ -391,6 +391,7 @@ int main(int argc, char **argv) { initializeTarget(Registry); // For codegen passes, only passes that do IR to IR transformation are // supported. + initializeExpandMemCmpPassPass(Registry); initializeScalarizeMaskedMemIntrinPass(Registry); initializeCodeGenPreparePass(Registry); initializeAtomicExpandPass(Registry); @@ -401,10 +402,13 @@ int main(int argc, char **argv) { initializeSjLjEHPreparePass(Registry); initializePreISelIntrinsicLoweringLegacyPassPass(Registry); initializeGlobalMergePass(Registry); + initializeIndirectBrExpandPassPass(Registry); initializeInterleavedAccessPass(Registry); - initializeCountingFunctionInserterPass(Registry); + initializeEntryExitInstrumenterPass(Registry); + initializePostInlineEntryExitInstrumenterPass(Registry); initializeUnreachableBlockElimLegacyPassPass(Registry); initializeExpandReductionsPass(Registry); + initializeWriteBitcodePassPass(Registry); #ifdef LINK_POLLY_INTO_TOOLS polly::initializePollyPasses(Registry); @@ -430,21 +434,22 @@ int main(int argc, char **argv) { if (PassRemarksHotnessThreshold) Context.setDiagnosticsHotnessThreshold(PassRemarksHotnessThreshold); - std::unique_ptr<tool_output_file> YamlFile; + std::unique_ptr<ToolOutputFile> OptRemarkFile; if (RemarksFilename != "") { std::error_code EC; - YamlFile = llvm::make_unique<tool_output_file>(RemarksFilename, EC, - sys::fs::F_None); + OptRemarkFile = + llvm::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::F_None); if (EC) { errs() << EC.message() << '\n'; return 1; } Context.setDiagnosticsOutputFile( - llvm::make_unique<yaml::Output>(YamlFile->os())); + llvm::make_unique<yaml::Output>(OptRemarkFile->os())); } // Load the input module... - std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context); + std::unique_ptr<Module> M = + parseIRFile(InputFilename, Err, Context, !NoVerify); if (!M) { Err.print(argv[0], errs()); @@ -471,8 +476,8 @@ int main(int argc, char **argv) { M->setDataLayout(ClDataLayout); // Figure out what stream we are supposed to write to... - std::unique_ptr<tool_output_file> Out; - std::unique_ptr<tool_output_file> ThinLinkOut; + std::unique_ptr<ToolOutputFile> Out; + std::unique_ptr<ToolOutputFile> ThinLinkOut; if (NoOutput) { if (!OutputFilename.empty()) errs() << "WARNING: The -o (output filename) option is ignored when\n" @@ -483,7 +488,7 @@ int main(int argc, char **argv) { OutputFilename = "-"; std::error_code EC; - Out.reset(new tool_output_file(OutputFilename, EC, sys::fs::F_None)); + Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); if (EC) { errs() << EC.message() << '\n'; return 1; @@ -491,7 +496,7 @@ int main(int argc, char **argv) { if (!ThinLinkBitcodeFile.empty()) { ThinLinkOut.reset( - new tool_output_file(ThinLinkBitcodeFile, EC, sys::fs::F_None)); + new ToolOutputFile(ThinLinkBitcodeFile, EC, sys::fs::F_None)); if (EC) { errs() << EC.message() << '\n'; return 1; @@ -540,7 +545,8 @@ int main(int argc, char **argv) { // string. Hand off the rest of the functionality to the new code for that // layer. return runPassPipeline(argv[0], *M, TM.get(), Out.get(), ThinLinkOut.get(), - PassPipeline, OK, VK, PreserveAssemblyUseListOrder, + OptRemarkFile.get(), PassPipeline, OK, VK, + PreserveAssemblyUseListOrder, PreserveBitcodeUseListOrder, EmitSummaryIndex, EmitModuleHash) ? 0 @@ -579,8 +585,8 @@ int main(int argc, char **argv) { OutputFilename = "-"; std::error_code EC; - Out = llvm::make_unique<tool_output_file>(OutputFilename, EC, - sys::fs::F_None); + Out = llvm::make_unique<ToolOutputFile>(OutputFilename, EC, + sys::fs::F_None); if (EC) { errs() << EC.message() << '\n'; return 1; @@ -767,8 +773,8 @@ int main(int argc, char **argv) { "the compile-twice option\n"; Out->os() << BOS->str(); Out->keep(); - if (YamlFile) - YamlFile->keep(); + if (OptRemarkFile) + OptRemarkFile->keep(); return 1; } Out->os() << BOS->str(); @@ -778,8 +784,8 @@ int main(int argc, char **argv) { if (!NoOutput || PrintBreakpoints) Out->keep(); - if (YamlFile) - YamlFile->keep(); + if (OptRemarkFile) + OptRemarkFile->keep(); if (ThinLinkOut) ThinLinkOut->keep(); |
