-
Notifications
You must be signed in to change notification settings - Fork 0
/
func_def.hpp
39 lines (31 loc) · 841 Bytes
/
func_def.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef FUNC_DEF_HPP
#define FUNC_DEF_HPP
#include <llvm/IR/Function.h>
#include "ast.hpp"
#include "decl_common.hpp"
#include "declarator.hpp"
#include "statement.hpp"
class external_decl : public ast_node {
public:
virtual void codegen(){};
};
class func_def : public external_decl {
declaration_specs *decl_specs;
declarator_node *declarator;
compound_stmt *statement;
function_declarator *func_decl;
public:
func_def(declaration_specs *decl_specs, declarator_node *declarator,
compound_stmt *statement);
static void old_style_error();
void dump_tree() override;
void codegen() override;
};
class trans_unit : public ast_node {
std::vector<external_decl *> external_decls;
public:
trans_unit *add(external_decl *decl);
void dump_tree() override;
void codegen();
};
#endif /* FUNC_DEF_HPP */