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

Function HasUsedDeclarations

shadercompiler/ParserUtils.cpp:221–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221static bool HasUsedDeclarations( ASTNode* node )
222{
223 for( unsigned i = 0; i < node->GetChildrenCount(); ++i )
224 {
225 ASTNode* child = node->GetChild( i );
226 if( child )
227 {
228 if( child->GetNodeType() == NT_VAR_DECLARATION_LIST ||
229 child->GetNodeType() == NT_STRUCT_MEMBER )
230 {
231 if( HasUsedDeclarations( child ) )
232 {
233 return true;
234 }
235 }
236 else if( child->GetNodeType() == NT_NAME_DECLARATION )
237 {
238 if( child->GetSymbol() && child->GetSymbol()->used )
239 {
240 return true;
241 }
242 }
243 }
244 }
245 return false;
246}
247
248static void MarkCBuffersAndStructsUsed( ASTNode* node, SymbolTable& symbols )
249{

Callers 1

Calls 4

GetChildrenCountMethod · 0.80
GetNodeTypeMethod · 0.80
GetSymbolMethod · 0.80
GetChildMethod · 0.45

Tested by

no test coverage detected