Skip to content
  • Marek Olšák's avatar
    ac: add reusable helpers for direct LLVM compilation · 0075e5fe
    Marek Olšák authored
    
    
    This is basically LLVMTargetMachineEmitToMemoryBuffer inlined and reworked.
    
    struct ac_compiler_passes (opaque type) contains the main pass manager.
    
    ac_create_llvm_passes -- the result can go to thread local storage
    ac_destroy_llvm_passes -- can be called by a destructor in TLS
    ac_compile_module_to_binary -- from LLVMModuleRef to ac_shader_binary
    
    The motivation is to do the expensive call addPassesToEmitFile once
    per context or thread.
    
    Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
    0075e5fe