Brain  1.0.0
A fast esoteric language!
ASTInfo.h
1 /* This is the source code of Brain Programming Language.
2  * It is licensed under GNU GPL v. 3 or later.
3  * You should have received a copy of the license in this archive (see LICENSE).
4  *
5  * Copyright Brain, 2016.
6  */
7 
8 #ifndef AST_INFO_H
9 #define AST_INFO_H
10 
11 #include <llvm/IR/LLVMContext.h>
12 #include <llvm/IR/IRBuilder.h>
13 #include <llvm/IR/Module.h>
14 #include <llvm/IR/Value.h>
15 
19 class ASTInfo
20 {
21 private:
25  ASTInfo() {}
26 
28  static ASTInfo *_instance;
30  static llvm::GlobalVariable *__brain_index_ptr;
32  static llvm::GlobalVariable *__brain_cells_ptr;
33 public:
34  ASTInfo(ASTInfo const&) = delete;
35  ASTInfo& operator=(ASTInfo const&) = delete;
41  static ASTInfo* instance();
48  void code_gen(llvm::Module *M, llvm::IRBuilder<> &B);
52  llvm::GlobalVariable* get_index_ptr();
56  llvm::GlobalVariable* get_cells_ptr();
63 };
64 
65 #endif // AST_INFO_H
66 
static ASTInfo * instance()
Returns the instance of ASTInfo class if the member _instance is nullptr, otherwise it creates a new ...
Definition: ASTInfo.cpp:15
llvm::GlobalVariable * get_index_ptr()
Definition: ASTInfo.cpp:24
llvm::GlobalVariable * get_cells_ptr()
Definition: ASTInfo.cpp:29
bool is_using_io_lib
Controls if the io.ll module is included within the module which is being interpreted, if the module does not uses any function defined in io.c so it won&#39;t include io.ll in their .ll code.
Definition: ASTInfo.h:62
The abstract syntax tree.
Definition: ASTInfo.h:19
void code_gen(llvm::Module *M, llvm::IRBuilder<> &B)
Generates the IR (Intermediate Representation) code to be executed by llvm.
Definition: ASTInfo.cpp:34