Skip to content

Commit

Permalink
Update method name
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Hellmuth <[email protected]>
  • Loading branch information
chellmuth committed Aug 17, 2023
1 parent 4587b05 commit c2a58ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/liboslexec/backendllvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/liboslexec/backendllvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/liboslexec/llvm_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c2a58ce

Please sign in to comment.