search for: modulepointer

Displaying 3 results from an estimated 3 matches for "modulepointer".

2008 Dec 19
2
[LLVMdev] strange behaviour after extracting optimization pass code
...or optimization of a llvm-function in a llvm-module and put it into a separate function for better readability. The original code looks like follows (and works as expected): ----------------------------- std::string functionName = "main"; llvm::Module* mod = some arbitrary valid modulepointer; llvm::ExistingModuleProvider mp(mod); llvm::FunctionPassManager fpm(&mp); fpm.add(new llvm::TargetData(mod)); fpm.add(llvm::createInstructionCombiningPass()); fpm.add(llvm::createReassociatePass()); fpm.add(llvm::createGVNPass()); fpm.add(llvm::createCFGSimplificationPass(...
2008 Dec 19
1
[LLVMdev] strange behaviour after extracting optimization pass code
...optimization of a llvm-function in a llvm-module and put it into a separate function for better readability. The original code looks like follows (and works as expected): ----------------------------- std::string functionName = "main"; llvm::Module* mod = some arbitrary valid modulepointer; llvm::ExistingModuleProvider mp(mod); llvm::FunctionPassManager fpm(&mp); fpm.add(new llvm::TargetData(mod)); fpm.add(llvm::createInstructionCombiningPass()); fpm.add(llvm::createReassociatePass()); fpm.add(llvm::createGVNPass()); fpm.add(llvm::createCFGSimplificati...
2008 Dec 19
0
[LLVMdev] strange behaviour after extracting optimization pass code
...n below. The fix is simply to leave the 'mp' variable in the caller so it doesn't go out of scope before you're done with the Module. — Gordon > ----------------------------- > std::string functionName = "main"; > llvm::Module* mod = some arbitrary valid modulepointer; { > > llvm::ExistingModuleProvider mp(mod); > llvm::FunctionPassManager fpm(&mp); > fpm.add(new llvm::TargetData(mod)); > fpm.add(llvm::createInstructionCombiningPass()); > fpm.add(llvm::createReassociatePass()); > fpm.add(llvm::createGVNPass()); > fpm.add...