From beaa95d97f319dc9b93b89850ab2ed9790182166 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Fri, 14 Mar 2014 04:04:14 +0000 Subject: static link polly into tools git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203886 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/CMakeLists.txt | 9 +++++++++ tools/opt/opt.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+) (limited to 'tools/opt') diff --git a/tools/opt/CMakeLists.txt b/tools/opt/CMakeLists.txt index 1f76ab5551..1d3f08db7d 100644 --- a/tools/opt/CMakeLists.txt +++ b/tools/opt/CMakeLists.txt @@ -32,3 +32,12 @@ add_llvm_tool(opt opt.cpp ) set_target_properties(opt PROPERTIES ENABLE_EXPORTS 1) + +if(WITH_POLLY AND LINK_POLLY_INTO_TOOLS) + target_link_libraries(opt Polly) + if(POLLY_LINK_LIBS) + foreach(lib ${POLLY_LINK_LIBS}) + target_link_libraries(opt ${lib}) + endforeach(lib) + endif(POLLY_LINK_LIBS) +endif(WITH_POLLY AND LINK_POLLY_INTO_TOOLS) diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 4dd9544fc3..5a198816e6 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -304,6 +304,12 @@ static TargetMachine* GetTargetMachine(Triple TheTriple) { GetCodeGenOptLevel()); } +#ifdef LINK_POLLY_INTO_TOOLS +namespace polly { +void initializePollyPasses(llvm::PassRegistry &Registry); +} +#endif + //===----------------------------------------------------------------------===// // main for opt // @@ -338,6 +344,10 @@ int main(int argc, char **argv) { // supported. For now, just add CodeGenPrepare. initializeCodeGenPreparePass(Registry); +#ifdef LINK_POLLY_INTO_TOOLS + polly::initializePollyPasses(Registry); +#endif + cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .bc modular optimizer and analysis printer\n"); -- cgit v1.2.3