[LLVMdev] Strange LLVM Crash

Nick Lewycky nicholas at mxc.ca
Sat Mar 14 13:13:38 PDT 2009


Nyx wrote:
> Ok, well, I seem to have pinpointed the cause of the problem more accurately.
> I'm running some optimization passes on my module after I compile each
> function in my scripting language (functions can be compiled at various
> times, when scripts are loaded). Now it seems these optimization passes will
> prune some of the native C++ functions I'm registering in my module (the
> functions that haven't been called/used yet). I'd like to find a way to
> disable this so that all the native functions I register will stay in the
> module.

"externally visible" functions should never be deleted. What's the 
linkage type on your functions? internal? Don't mark things internal 
unless you don't mind if they go away. :)

Nick

> Here are the optimization passes I'm running:
> 
> 	passManager.add(new llvm::TargetData(s_pModule));
> 	passManager.add(llvm::createLowerSetJmpPass());
> 	passManager.add(llvm::createRaiseAllocationsPass());
> 	passManager.add(llvm::createCFGSimplificationPass());
> 	passManager.add(llvm::createPromoteMemoryToRegisterPass());
> 	passManager.add(llvm::createGlobalOptimizerPass());
> 	passManager.add(llvm::createGlobalDCEPass());
> 	passManager.add(llvm::createFunctionInliningPass());
> 
> I would like to know either which pass does this (global optimizer maybe?)
> so I can disable it, or what flag I can set on my C++ function objects to
> keep them from being pruned out.




More information about the llvm-dev mailing list