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

Method LookupGlobal

shadercompiler/SymbolTable.cpp:494–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494Symbol* SymbolTable::LookupGlobal( const char* string ) const
495{
496 if( m_root->m_subBlocks.empty() )
497 {
498 return nullptr;
499 }
500 InlineString toFind = MakeInlineString( string );
501 auto equals = [=]( Symbol* symbol ) { return symbol->name == toFind; };
502 auto symbol = std::find_if( m_root->m_subBlocks[0]->m_symbols.begin(), m_root->m_subBlocks[0]->m_symbols.end(), equals );
503 if( symbol != m_root->m_subBlocks[0]->m_symbols.end() )
504 {
505 return *symbol;
506 }
507 return nullptr;
508}
509
510bool SymbolTable::IsGlobal( Symbol* symbol ) const
511{

Callers 6

ProcessReflectionFunction · 0.80
ExtractAnnotationsFunction · 0.80
GetStageDataForNodeFunction · 0.80
CreateGlobalInputsStructFunction · 0.80
MarkUsedSymbolsFunction · 0.80
ParseGlobalInputFunction · 0.80

Calls 4

MakeInlineStringFunction · 0.85
emptyMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected