From: Dave Airlie Date: Tue, 26 Jun 2018 23:34:42 +0000 (+1000) Subject: ac: add target library info helpers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=887ba45c93b0a8cab664d1cd0bff104c862c479d;p=mesa.git ac: add target library info helpers Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Marek Olšák --- diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp index 495bd98da9c..48a5a44e392 100644 --- a/src/amd/common/ac_llvm_helper.cpp +++ b/src/amd/common/ac_llvm_helper.cpp @@ -36,6 +36,7 @@ #include #include #include +#include void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes) { @@ -97,3 +98,15 @@ LLVMBuilderRef ac_create_builder(LLVMContextRef ctx, return builder; } + +LLVMTargetLibraryInfoRef +ac_create_target_library_info(const char *triple) +{ + return reinterpret_cast(new llvm::TargetLibraryInfoImpl(llvm::Triple(triple))); +} + +void +ac_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info) +{ + delete reinterpret_cast(library_info); +} diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h index 8d4f7d83150..1175971e257 100644 --- a/src/amd/common/ac_llvm_util.h +++ b/src/amd/common/ac_llvm_util.h @@ -113,6 +113,8 @@ ac_count_scratch_private_memory(LLVMValueRef function); LLVMPassManagerRef ac_create_passmgr(LLVMTargetLibraryInfoRef target_library_info, bool check_ir); +LLVMTargetLibraryInfoRef ac_create_target_library_info(const char *triple); +void ac_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info); void ac_init_llvm_once(void); #ifdef __cplusplus