ac: destroy passes in ac_destroy_llvm_compiler
authorMarek Olšák <marek.olsak@amd.com>
Sat, 29 Jun 2019 06:25:23 +0000 (02:25 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 4 Jul 2019 19:39:04 +0000 (15:39 -0400)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/amd/common/ac_llvm_util.c
src/amd/vulkan/radv_llvm_helper.cpp
src/gallium/drivers/radeonsi/si_pipe.c

index c153d60..1cf51b7 100644 (file)
@@ -356,6 +356,9 @@ fail:
 void
 ac_destroy_llvm_compiler(struct ac_llvm_compiler *compiler)
 {
+       ac_destroy_llvm_passes(compiler->passes);
+       ac_destroy_llvm_passes(compiler->low_opt_passes);
+
        if (compiler->passmgr)
                LLVMDisposePassManager(compiler->passmgr);
        if (compiler->target_library_info)
index 036368b..2b14ddc 100644 (file)
@@ -33,7 +33,6 @@ public:
 
        ~radv_llvm_per_thread_info()
        {
-               ac_destroy_llvm_passes(passes);
                ac_destroy_llvm_compiler(&llvm_info);
        }
 
index 2ad164a..0b3776b 100644 (file)
@@ -143,8 +143,6 @@ static void si_init_compiler(struct si_screen *sscreen,
 
 static void si_destroy_compiler(struct ac_llvm_compiler *compiler)
 {
-       ac_destroy_llvm_passes(compiler->passes);
-       ac_destroy_llvm_passes(compiler->low_opt_passes);
        ac_destroy_llvm_compiler(compiler);
 }