Skip to content
Snippets Groups Projects
Commit 8aa1ebcd authored by Zuzana Baranová's avatar Zuzana Baranová
Browse files

RT: Move DiOS-specific link_bitcode parts into NativeDiosCC.

parent f6823017
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,24 @@ auto NativeDiosCC::link_dios_native( bool cxx ) ...@@ -91,7 +91,24 @@ auto NativeDiosCC::link_dios_native( bool cxx )
std::unique_ptr< llvm::Module > NativeDiosCC::link_bitcode() std::unique_ptr< llvm::Module > NativeDiosCC::link_bitcode()
{ {
return cc::link_bitcode< rt::DiosCC, true >( _files, _clang, _po.libSearchPath ); auto drv = std::make_unique< DiosCC >( _clang.context() );
std::unique_ptr< llvm::Module > m = Native::do_link_bitcode< rt::DiosCC >();
drv->link( std::move( m ) );
drv->linkLibs( DiosCC::defaultDIVINELibs );
m = drv->takeLinked();
for ( auto& func : *m )
if ( func.isDeclaration() && !whitelisted( func ) )
throw cc::CompileError( "Symbol undefined (function): " + func.getName().str() );
for ( auto& val : m->globals() )
if ( auto G = dyn_cast< llvm::GlobalVariable >( &val ) )
if ( !G->hasInitializer() && !whitelisted( *G ) )
throw cc::CompileError( "Symbol undefined (global variable): " + G->getName().str() );
verifyModule( *m );
return m;
} }
void NativeDiosCC::link() void NativeDiosCC::link()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment