diff options
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-as/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | llvm/tools/llvm-as/LLVMBuild.txt | 2 | ||||
| -rw-r--r-- | llvm/tools/llvm-as/llvm-as.cpp | 14 | ||||
| -rw-r--r-- | llvm/tools/opt/opt.cpp | 9 |
4 files changed, 11 insertions, 15 deletions
diff --git a/llvm/tools/llvm-as/CMakeLists.txt b/llvm/tools/llvm-as/CMakeLists.txt index 9b9027b7061..1b2789a4de4 100644 --- a/llvm/tools/llvm-as/CMakeLists.txt +++ b/llvm/tools/llvm-as/CMakeLists.txt @@ -1,5 +1,4 @@ set(LLVM_LINK_COMPONENTS - Analysis AsmParser BitWriter Core diff --git a/llvm/tools/llvm-as/LLVMBuild.txt b/llvm/tools/llvm-as/LLVMBuild.txt index cef557ac7a2..542470bbdd8 100644 --- a/llvm/tools/llvm-as/LLVMBuild.txt +++ b/llvm/tools/llvm-as/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Tool name = llvm-as parent = Tools -required_libraries = Analysis AsmParser BitWriter +required_libraries = AsmParser BitWriter diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp index 89397cde3ef..1e795083992 100644 --- a/llvm/tools/llvm-as/llvm-as.cpp +++ b/llvm/tools/llvm-as/llvm-as.cpp @@ -15,7 +15,6 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/ModuleSummaryAnalysis.h" #include "llvm/AsmParser/Parser.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/LLVMContext.h" @@ -45,10 +44,6 @@ 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> EmitSummaryIndex("module-summary", - cl::desc("Emit module summary index"), - cl::init(false)); - static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"), cl::init(false)); @@ -84,14 +79,9 @@ static void WriteOutputFile(const Module *M) { exit(1); } - if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) { - std::unique_ptr<ModuleSummaryIndex> Index; - if (EmitSummaryIndex) - Index = ModuleSummaryIndexBuilder(M).takeIndex(); - - WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder, Index.get(), + if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) + WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder, nullptr, EmitModuleHash); - } // Declare success. Out->keep(); diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index e374e1f5446..9a920ad6baf 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -158,6 +158,12 @@ DisableSLPVectorization("disable-slp-vectorization", cl::desc("Disable the slp vectorization pass"), cl::init(false)); +static cl::opt<bool> EmitSummaryIndex("module-summary", + cl::desc("Emit module summary index"), + cl::init(false)); + +static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"), + cl::init(false)); static cl::opt<bool> DisableSimplifyLibCalls("disable-simplify-libcalls", @@ -617,7 +623,8 @@ int main(int argc, char **argv) { if (OutputAssembly) Passes.add(createPrintModulePass(*OS, "", PreserveAssemblyUseListOrder)); else - Passes.add(createBitcodeWriterPass(*OS, PreserveBitcodeUseListOrder)); + Passes.add(createBitcodeWriterPass(*OS, PreserveBitcodeUseListOrder, + EmitSummaryIndex, EmitModuleHash)); } // Before executing passes, print the final values of the LLVM options. |

