tipc
A TIP to LLVM compiler
FunctionNameCollector.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ASTVisitor.h"
4 #include <map>
5 
15 public:
16  FunctionNameCollector() = default;
17  // this map is public so that the static method can access it
18  std::map<std::string, std::pair<ASTDeclNode *, bool>> fMap;
19  static std::map<std::string, std::pair<ASTDeclNode *, bool>>
20  build(ASTProgram *p);
21  virtual bool visit(ASTFunction *element) override;
22 };
Class for defining the signature, local declarations, and a body of a function.
Definition: ASTFunction.h:11
Class for a program which is a name and a list of functions.
Definition: ASTProgram.h:11
Base class for AST visitors.
Definition: ASTVisitor.h:23
Collects the names of functions declared in the program.
Definition: FunctionNameCollector.h:14
virtual bool visit(ASTFunction *element) override
Definition: FunctionNameCollector.cpp:15
std::map< std::string, std::pair< ASTDeclNode *, bool > > fMap
Definition: FunctionNameCollector.h:18
static std::map< std::string, std::pair< ASTDeclNode *, bool > > build(ASTProgram *p)
Definition: FunctionNameCollector.cpp:5
FunctionNameCollector()=default