MCPcopy Create free account
hub / github.com/carbonengine/trinity / AddFunctionArgument

Function AddFunctionArgument

shadercompiler/EffectCompilerMetal.cpp:237–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void AddFunctionArgument( ASTNode* parent, const Symbol* functionSymbol, Symbol* arg )
238{
239 assert( parent );
240
241 for( size_t i = 0, n = parent->GetChildrenCount(); i < n; ++i )
242 {
243 ASTNode* node = parent->GetChild( i );
244 if( !node )
245 {
246 continue;
247 }
248
249 if( node->GetNodeType() == NT_FUNCTION_CALL &&
250 node->GetSymbol() == functionSymbol )
251 {
252 ASTNode* child = new ASTNode( NT_VAR_IDENTIFIER, node->GetLocation(), node->GetScope(), nullptr );
253 child->SetSymbol( arg );
254
255 node->InsertChild( 0, child );
256 }
257
258 AddFunctionArgument( node, functionSymbol, arg );
259 }
260}
261
262void AddFunctionArgument( std::map<Symbol*, ASTNode*>& functions, const Symbol* functionSymbol, Symbol* arg )
263{

Callers 2

PatchGlobalsInFunctionsFunction · 0.85

Calls 7

GetChildrenCountMethod · 0.80
GetNodeTypeMethod · 0.80
GetSymbolMethod · 0.80
GetScopeMethod · 0.80
SetSymbolMethod · 0.80
InsertChildMethod · 0.80
GetChildMethod · 0.45

Tested by

no test coverage detected