VapourSynth-llvmexpr
Loading...
Searching...
No Matches
analysis::var_naming Namespace Reference

Functions

std::string getArrayName (std::string_view base_name)
bool isArrayName (std::string_view name)
std::string getBaseName (std::string_view array_name)

Variables

constexpr std::string_view ARRAY_SUFFIX = "{}"

Detailed Description

Copyright (C) 2025 yuygfgg

This file is part of Vapoursynth-llvmexpr.

Vapoursynth-llvmexpr is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Vapoursynth-llvmexpr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Vapoursynth-llvmexpr. If not, see https://www.gnu.org/licenses/.

Function Documentation

◆ getArrayName()

std::string analysis::var_naming::getArrayName ( std::string_view base_name)
inline

Definition at line 30 of file VarNaming.hpp.

30 {
31 return std::string(base_name) + std::string(ARRAY_SUFFIX);
32}
constexpr std::string_view ARRAY_SUFFIX
Definition VarNaming.hpp:28

References ARRAY_SUFFIX.

Referenced by analysis::StaticAllocReachabilityAnalysis::computeGenSet(), analysis::VarInitAnalysis::computeGenSet(), analysis::ValidationPass::run(), and analysis::VarInitPass::run().

◆ getBaseName()

std::string analysis::var_naming::getBaseName ( std::string_view array_name)
inline

Definition at line 38 of file VarNaming.hpp.

38 {
39 if (isArrayName(array_name)) {
40 return std::string(
41 array_name.substr(0, array_name.size() - ARRAY_SUFFIX.size()));
42 }
43 return std::string(array_name);
44}
bool isArrayName(std::string_view name)
Definition VarNaming.hpp:34

References ARRAY_SUFFIX, and isArrayName().

◆ isArrayName()

bool analysis::var_naming::isArrayName ( std::string_view name)
inline

Definition at line 34 of file VarNaming.hpp.

34 {
35 return name.ends_with(ARRAY_SUFFIX);
36}

References ARRAY_SUFFIX.

Referenced by getBaseName().

Variable Documentation

◆ ARRAY_SUFFIX

std::string_view analysis::var_naming::ARRAY_SUFFIX = "{}"
inlineconstexpr

Definition at line 28 of file VarNaming.hpp.

Referenced by getArrayName(), getBaseName(), and isArrayName().