From 8048c44580056994eb0f2804e2914badc8fbef43 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Sat, 22 Feb 2014 00:07:45 +0000 Subject: [CodeGenPrepare] Move CodeGenPrepare into lib/CodeGen. CodeGenPrepare uses extensively TargetLowering which is part of libLLVMCodeGen. This is a layer violation which would introduce eventually a dependence on CodeGen in ScalarOpts. Move CodeGenPrepare into libLLVMCodeGen to avoid that. Follow-up of git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201912 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/opt.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/opt/opt.cpp') diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index fa9bc678c3..b9d3f9d6d2 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -22,6 +22,7 @@ #include "llvm/Analysis/RegionPass.h" #include "llvm/Bitcode/BitcodeWriterPass.h" #include "llvm/CodeGen/CommandFlags.h" +#include "llvm/InitializePasses.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/IRPrintingPasses.h" #include "llvm/IR/LLVMContext.h" @@ -340,6 +341,9 @@ int main(int argc, char **argv) { initializeInstCombine(Registry); initializeInstrumentation(Registry); initializeTarget(Registry); + // For codegen passes, only passes that do IR to IR transformation are + // supported. For now, just add CodeGenPrepare. + initializeCodeGenPreparePass(Registry); cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n"); -- cgit v1.2.3