forked from OSchip/llvm-project
parent
a59005be81
commit
17fac04433
|
@ -110,3 +110,11 @@ if(CLANG_ORDER_FILE)
|
|||
target_link_libraries(clang "-Wl,-order_file,${CLANG_ORDER_FILE}")
|
||||
endif()
|
||||
|
||||
if(WITH_POLLY AND LINK_POLLY_INTO_TOOLS)
|
||||
target_link_libraries(clang Polly)
|
||||
if(POLLY_LINK_LIBS)
|
||||
foreach(lib ${POLLY_LINK_LIBS})
|
||||
target_link_libraries(clang ${lib})
|
||||
endforeach(lib)
|
||||
endif(POLLY_LINK_LIBS)
|
||||
endif(WITH_POLLY AND LINK_POLLY_INTO_TOOLS)
|
||||
|
|
|
@ -57,6 +57,12 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message,
|
|||
exit(GenCrashDiag ? 70 : 1);
|
||||
}
|
||||
|
||||
#ifdef LINK_POLLY_INTO_TOOLS
|
||||
namespace polly {
|
||||
void initializePollyPasses(llvm::PassRegistry &Registry);
|
||||
}
|
||||
#endif
|
||||
|
||||
int cc1_main(const char **ArgBegin, const char **ArgEnd,
|
||||
const char *Argv0, void *MainAddr) {
|
||||
std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
|
||||
|
@ -68,6 +74,11 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
|
|||
llvm::InitializeAllAsmPrinters();
|
||||
llvm::InitializeAllAsmParsers();
|
||||
|
||||
#ifdef LINK_POLLY_INTO_TOOLS
|
||||
llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry();
|
||||
polly::initializePollyPasses(Registry);
|
||||
#endif
|
||||
|
||||
// Buffer diagnostics from argument parsing so that we can output them using a
|
||||
// well formed diagnostic object.
|
||||
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
|
||||
|
|
Loading…
Reference in New Issue