#include "compiler/translator/tree_util/ReplaceVariable.h"
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/Symbol.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
namespace
{
class ReplaceVariableTraverser : public TIntermTraverser
{ … };
class ReplaceVariablesTraverser : public TIntermTraverser
{ … };
class GetDeclaratorReplacementsTraverser : public TIntermTraverser
{ … };
}
[[nodiscard]] bool ReplaceVariable(TCompiler *compiler,
TIntermBlock *root,
const TVariable *toBeReplaced,
const TVariable *replacement)
{ … }
[[nodiscard]] bool ReplaceVariables(TCompiler *compiler,
TIntermBlock *root,
const VariableReplacementMap &variableMap)
{ … }
void GetDeclaratorReplacements(TSymbolTable *symbolTable,
TIntermBlock *root,
VariableReplacementMap *variableMap)
{ … }
[[nodiscard]] bool ReplaceVariableWithTyped(TCompiler *compiler,
TIntermBlock *root,
const TVariable *toBeReplaced,
const TIntermTyped *replacement)
{ … }
}