From 1bfdbc61f2e14d8b0f2b5ca45ca8266c363cbfc5 Mon Sep 17 00:00:00 2001 From: Andrea Mattavelli Date: Fri, 16 Sep 2016 10:04:27 +0100 Subject: Avoid internalization of non-standard entry point (i.e. not the main function) (#455) --- lib/Module/KModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Module/KModule.cpp') diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 01165e94..57346a31 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -132,7 +132,7 @@ KModule::~KModule() { /***/ namespace llvm { -extern void Optimize(Module*); +extern void Optimize(Module *, const std::string &EntryPoint); } // what a hack @@ -308,7 +308,7 @@ void KModule::prepare(const Interpreter::ModuleOptions &opts, pm.run(*module); if (opts.Optimize) - Optimize(module); + Optimize(module, opts.EntryPoint); #if LLVM_VERSION_CODE < LLVM_VERSION(3, 3) // Force importing functions required by intrinsic lowering. Kind of // unfortunate clutter when we don't need them but we won't know -- cgit 1.4.1