void FunctionCounter::declare(){ // declare any shared library that will contain instrumentation functions declareLibrary(INST_LIB_NAME); // declare any instrumentation functions that will be used exitFunc = declareFunction(EXIT_FUNCTION); ASSERT(exitFunc && "Cannot find exit function, are you sure it was declared?"); entryFunc = declareFunction(ENTRY_FUNCTION); ASSERT(entryFunc && "Cannot find entry function, are you sure it was declared?"); }
void processDeclarationNode(AST_NODE* declarationNode) { //different declaration insert symbol table AST_NODE* child = declarationNode->child; DECL_KIND kind = declarationNode->semantic_value.declSemanticValue.kind; switch(kind){ case TYPE_DECL: processTypeNode(child); break; case VARIABLE_DECL: { declareIdList(child, VARIABLE_ATTRIBUTE, False); break; } case FUNCTION_DECL: { declareFunction(child); break; } default: { assert(0); } } }
void CallReplace::declare(){ // declare any shared library that will contain instrumentation functions for (uint32_t i = 0; i < libraries.size(); i++){ declareLibrary(libraries[i]); } // declare any instrumentation functions that will be used programEntry = declareFunction(PROGRAM_ENTRY); ASSERT(programEntry); programExit = declareFunction(PROGRAM_EXIT); ASSERT(programExit); for (uint32_t i = 0; i < (*functionList).size(); i++){ functionWrappers.append(declareFunction(getWrapperName(i))); functionWrappers.back()->setSkipWrapper(); } }
void BasicBlockCounter::declare() { InstrumentationTool::declare(); ASSERT(currentPhase == ElfInstPhase_user_declare && "Instrumentation phase order must be observed"); // declare any shared library that will contain instrumentation functions declareLibrary(INST_LIB_NAME); // declare any instrumentation functions that will be used exitFunc = declareFunction(EXIT_FUNCTION); ASSERT(exitFunc && "Cannot find exit function, are you sure it was declared?"); entryFunc = declareFunction(ENTRY_FUNCTION); ASSERT(entryFunc && "Cannot find entry function, are you sure it was declared?"); ASSERT(currentPhase == ElfInstPhase_user_declare && "Instrumentation phase order must be observed"); }
void BytecodeTranslatorVisitor::beforeProcessBlock() { for (Scope::VarIterator iter(scope()); iter.hasNext();) variableInScope(iter.next()); for (Scope::FunctionIterator iter(scope()); iter.hasNext();) declareFunction(iter.next()); for (Scope::FunctionIterator iter(scope()); iter.hasNext();) visitAstFunction(iter.next()); }
FunctionDefinitionNode::FunctionDefinitionNode( CompoundStatementNode* _compoundStatement, DeclaratorNode* _declarator , SymbolTable* _table) : compoundStatement(_compoundStatement), declarator(_declarator), functionScope(_table->functionScope) { declareFunction( _table ); nodeData = toOperations(); }
void TauFunctionTrace::declare(){ //InstrumentationTool::declare(); if (inputFile){ instrumentList = new TauInstrumentList(inputFile, "BEGIN_INSTRUMENT_SECTION", "END_INSTRUMENT_SECTION", "BEGIN_EXCLUDE_LIST", "END_EXCLUDE_LIST"); } // declare any instrumentation functions that will be used functionRegister = declareFunction(REGISTER_FUNC); ASSERT(functionRegister); loopRegister = declareFunction(REGISTER_LOOP); ASSERT(loopRegister); functionEntry = declareFunction(ENTRY_FUNC_CALL); ASSERT(functionEntry); functionExit = declareFunction(EXIT_FUNC_CALL); ASSERT(functionExit); }
FunctionDefinitionNode::FunctionDefinitionNode( DeclarationSpecifiersNode* _declarationSpecifiers , CompoundStatementNode* _compoundStatement, DeclaratorNode* _declarator, DeclarationListNode* _declarationList, SymbolTable* _table ) : declarationSpecifiers(_declarationSpecifiers ), compoundStatement(_compoundStatement), declarator(_declarator),declarationList(_declarationList), functionScope(_table->functionScope) { declareFunction( _table ); nodeData = toOperations(); }
//! (static) void declareFunction(Namespace * nameSpace, const char * name, int minParamCount, int maxParamCount, Function::functionPtr fn) { declareFunction(nameSpace, stringToIdentifierId(name), minParamCount, maxParamCount, fn); }
//! (static) void declareFunction(Namespace * nameSpace, const char * name, Function::functionPtr fn) { declareFunction(nameSpace, stringToIdentifierId(name), fn); }
//! (static) void declareFunction(Type * type, const char * name, Function::functionPtr fn) { declareFunction(type, stringToIdentifierId(name), fn); }