[Mesa-dev] [PATCH] amd/common: Fix build with new ac_add_function_attr()

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Mar 1 22:56:38 UTC 2017


Pushed, thanks.

On Wed, Mar 1, 2017 at 10:16 PM, Tobias Klausmann
<tobias.johannes.klausmann at mni.thm.de> wrote:
> Fix usage of ac_add_function_attr() and make it known!
>
> common/ac_nir_to_llvm.c: In function 'create_llvm_function':
> common/ac_nir_to_llvm.c:265:4: error: implicit declaration of function
> 'ac_add_function_attr' [-Werror=implicit-function-declaration]
>     ac_add_function_attr(main_function, i + 1, AC_FUNC_ATTR_BYVAL);
>     ^~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> ---
>  src/amd/common/ac_llvm_util.c   | 3 +--
>  src/amd/common/ac_llvm_util.h   | 2 ++
>  src/amd/common/ac_nir_to_llvm.c | 4 ++--
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
> index fb525dd4c7..48fc9b2a33 100644
> --- a/src/amd/common/ac_llvm_util.c
> +++ b/src/amd/common/ac_llvm_util.c
> @@ -180,8 +180,7 @@ static const char *attr_to_str(enum ac_func_attr attr)
>
>  #endif
>
> -static void
> -ac_add_function_attr(LLVMContextRef ctx, LLVMValueRef function,
> +void ac_add_function_attr(LLVMContextRef ctx, LLVMValueRef function,
>                       int attr_idx, enum ac_func_attr attr)
>  {
>  #if HAVE_LLVM < 0x0400
> diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h
> index 4fe4ab4168..805db77178 100644
> --- a/src/amd/common/ac_llvm_util.h
> +++ b/src/amd/common/ac_llvm_util.h
> @@ -53,6 +53,8 @@ LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, bool su
>
>  void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
>  bool ac_is_sgpr_param(LLVMValueRef param);
> +void ac_add_function_attr(LLVMContextRef ctx, LLVMValueRef function,
> +                          int attr_idx, enum ac_func_attr attr);
>  void ac_add_func_attributes(LLVMContextRef ctx, LLVMValueRef function,
>                             unsigned attrib_mask);
>  void ac_dump_module(LLVMModuleRef module);
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index a800ff07d8..2228dd8159 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -262,11 +262,11 @@ create_llvm_function(LLVMContextRef ctx, LLVMModuleRef module,
>         for (unsigned i = 0; i < sgpr_params; ++i) {
>                 if (array_params_mask & (1 << i)) {
>                         LLVMValueRef P = LLVMGetParam(main_function, i);
> -                       ac_add_function_attr(main_function, i + 1, AC_FUNC_ATTR_BYVAL);
> +                       ac_add_function_attr(ctx, main_function, i + 1, AC_FUNC_ATTR_BYVAL);
>                         ac_add_attr_dereferenceable(P, UINT64_MAX);
>                 }
>                 else {
> -                       ac_add_function_attr(main_function, i + 1, AC_FUNC_ATTR_INREG);
> +                       ac_add_function_attr(ctx, main_function, i + 1, AC_FUNC_ATTR_INREG);
>                 }
>         }
>
> --
> 2.12.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list