|
|
|
@ -85,23 +85,6 @@ namespace vm
|
|
|
|
|
|
|
|
|
|
bool devirt_t::compile( std::vector< std::uint8_t > &obj )
|
|
|
|
|
{
|
|
|
|
|
llvm::legacy::FunctionPassManager pass_mgr( llvm_module );
|
|
|
|
|
pass_mgr.add( llvm::createPromoteMemoryToRegisterPass() );
|
|
|
|
|
pass_mgr.add( llvm::createCFGSimplificationPass() );
|
|
|
|
|
pass_mgr.add( llvm::createSROAPass() );
|
|
|
|
|
pass_mgr.add( llvm::createLoopSimplifyCFGPass() );
|
|
|
|
|
pass_mgr.add( llvm::createNewGVNPass() );
|
|
|
|
|
pass_mgr.add( llvm::createReassociatePass() );
|
|
|
|
|
pass_mgr.add( llvm::createPartiallyInlineLibCallsPass() );
|
|
|
|
|
pass_mgr.add( llvm::createDeadCodeEliminationPass() );
|
|
|
|
|
pass_mgr.add( llvm::createCFGSimplificationPass() );
|
|
|
|
|
pass_mgr.add( llvm::createInstructionCombiningPass() );
|
|
|
|
|
pass_mgr.add( llvm::createFlattenCFGPass() );
|
|
|
|
|
|
|
|
|
|
for ( auto vmp_rtn : vmp_rtns )
|
|
|
|
|
pass_mgr.run( *vmp_rtn->llvm_fptr );
|
|
|
|
|
|
|
|
|
|
// compile to native x86_64....
|
|
|
|
|
llvm::TargetOptions opt;
|
|
|
|
|
llvm::SmallVector< char, 128 > buff;
|
|
|
|
|
llvm::raw_svector_ostream dest( buff );
|
|
|
|
|