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
RevLine 
[3850]1/*
[4951]2 *  Copyright (c) 2016 International Characters.
[3850]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
[4237]7#ifndef PABLO_COMPILER_H
8#define PABLO_COMPILER_H
9
[4510]10#include <unordered_map>
[5267]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; }
[4237]21
[4416]22namespace pablo {
23
[4237]24class PabloCompiler {
[5310]25//    friend class CarryManager;
[5227]26
[5283]27    using TranslationMap = std::unordered_map<const PabloAST *, llvm::Value *>;
28
[4237]29public:
[5217]30    PabloCompiler(PabloKernel * kernel);
[5227]31    ~PabloCompiler();
32    void initializeKernelData();
[5297]33    void compile();
[4959]34
[4237]35private:
[4959]36
[5217]37    void Examine();
[5267]38
[5141]39    void Examine(const PabloBlock * const block);
[4684]40
[4970]41    void compileBlock(const PabloBlock * const block);
[5267]42
[4410]43    void compileStatement(const Statement * stmt);
[5267]44
[4535]45    void compileIf(const If * ifStmt);
[5267]46
[4535]47    void compileWhile(const While * whileStmt);
[5227]48
[5260]49    llvm::Value * compileExpression(const PabloAST * expr, const bool ensureLoaded = true) const;
[4237]50
[5227]51private:
[4663]52
[5283]53    IDISA::IDISA_Builder * const    iBuilder;
54    PabloKernel * const             mKernel;
55    CarryManager * const            mCarryManager;
56    TranslationMap                  mMarker;
57    TranslationMap                  mAccumulator;
[4237]58
59};
60
61}
62
[4951]63#endif // PABLO_COMPILER_H
Note: See TracBrowser for help on using the repository browser.