source: icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h @ 5310

Last change on this file since 5310 was 5310, checked in by nmedfort, 2 years ago

Adjusted pablo compiler to use getInputStream and getOutputStream when accessing packed stream fields.

File size: 1.5 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PABLO_COMPILER_H
8#define PABLO_COMPILER_H
9
10#include <unordered_map>
11namespace IDISA { class IDISA_Builder; }
12namespace llvm { class Function; }
13namespace llvm { class Value; }
14namespace pablo { class CarryManager; }
15namespace pablo { class If; }
16namespace pablo { class PabloAST; }
17namespace pablo { class PabloBlock; }
18namespace pablo { class PabloKernel; }
19namespace pablo { class Statement; }
20namespace pablo { class While; }
21
22namespace pablo {
23
24class PabloCompiler {
25//    friend class CarryManager;
26
27    using TranslationMap = std::unordered_map<const PabloAST *, llvm::Value *>;
28
29public:
30    PabloCompiler(PabloKernel * kernel);
31    ~PabloCompiler();
32    void initializeKernelData();
33    void compile();
34
35private:
36
37    void Examine();
38
39    void Examine(const PabloBlock * const block);
40
41    void compileBlock(const PabloBlock * const block);
42
43    void compileStatement(const Statement * stmt);
44
45    void compileIf(const If * ifStmt);
46
47    void compileWhile(const While * whileStmt);
48
49    llvm::Value * compileExpression(const PabloAST * expr, const bool ensureLoaded = true) const;
50
51private:
52
53    IDISA::IDISA_Builder * const    iBuilder;
54    PabloKernel * const             mKernel;
55    CarryManager * const            mCarryManager;
56    TranslationMap                  mMarker;
57    TranslationMap                  mAccumulator;
58
59};
60
61}
62
63#endif // PABLO_COMPILER_H
Note: See TracBrowser for help on using the repository browser.