From c2a58cef2b0c16f210f1d05e045a6264a3281694 Mon Sep 17 00:00:00 2001 From: Chris Hellmuth Date: Thu, 17 Aug 2023 10:08:32 -0700 Subject: [PATCH] Update method name Signed-off-by: Chris Hellmuth --- src/liboslexec/backendllvm.cpp | 7 ++++--- src/liboslexec/backendllvm.h | 2 +- src/liboslexec/llvm_instance.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/liboslexec/backendllvm.cpp b/src/liboslexec/backendllvm.cpp index f58afc28f..79bd7e127 100644 --- a/src/liboslexec/backendllvm.cpp +++ b/src/liboslexec/backendllvm.cpp @@ -237,7 +237,8 @@ BackendLLVM::getLLVMSymbolBase(const Symbol& sym) } if (sym.symtype() == SymTypeParam - || (sym.symtype() == SymTypeOutputParam && !is_stack_parameter(sym))) { + || (sym.symtype() == SymTypeOutputParam + && !can_treat_param_as_local(sym))) { // Special case for most params -- they live in the group data int fieldnum = m_param_order_map[&sym]; return groupdata_field_ptr(fieldnum, @@ -269,7 +270,7 @@ BackendLLVM::llvm_alloca(const TypeSpec& type, bool derivs, bool -BackendLLVM::is_stack_parameter(const Symbol& sym) +BackendLLVM::can_treat_param_as_local(const Symbol& sym) { if (!shadingsys().m_opt_groupdata) return false; @@ -286,7 +287,7 @@ BackendLLVM::getOrAllocateLLVMSymbol(const Symbol& sym) { OSL_DASSERT( (sym.symtype() == SymTypeLocal || sym.symtype() == SymTypeTemp - || sym.symtype() == SymTypeConst || is_stack_parameter(sym)) + || sym.symtype() == SymTypeConst || can_treat_param_as_local(sym)) && "getOrAllocateLLVMSymbol should only be for local, tmp, const"); Symbol* dealiased = sym.dealias(); std::string mangled_name = dealiased->mangled(); diff --git a/src/liboslexec/backendllvm.h b/src/liboslexec/backendllvm.h index e268d5eed..2ef59272b 100644 --- a/src/liboslexec/backendllvm.h +++ b/src/liboslexec/backendllvm.h @@ -215,7 +215,7 @@ class BackendLLVM final : public OSOProcessorBase { /// Checks if a symbol represents a parameter that can be stored on the /// stack instead of in GroupData - bool is_stack_parameter(const Symbol& sym); + bool can_treat_param_as_local(const Symbol& sym); /// Given the OSL symbol, return the llvm::Value* corresponding to the /// address of the start of that symbol (first element, first component, diff --git a/src/liboslexec/llvm_instance.cpp b/src/liboslexec/llvm_instance.cpp index a8e88cdc1..64a35a344 100644 --- a/src/liboslexec/llvm_instance.cpp +++ b/src/liboslexec/llvm_instance.cpp @@ -352,7 +352,7 @@ BackendLLVM::llvm_type_groupdata() if (ts.is_structure()) // skip the struct symbol itself continue; - if (is_stack_parameter(sym)) + if (can_treat_param_as_local(sym)) continue; const int arraylen = std::max(1, sym.typespec().arraylength()); @@ -1244,7 +1244,7 @@ BackendLLVM::build_llvm_instance(bool groupentry) continue; // Allocate space for locals, temps, aggregate constants and some output params if (s.symtype() == SymTypeLocal || s.symtype() == SymTypeTemp - || s.symtype() == SymTypeConst || is_stack_parameter(s)) + || s.symtype() == SymTypeConst || can_treat_param_as_local(s)) getOrAllocateLLVMSymbol(s); // Set initial value for constants, closures, and strings that are // not parameters.