source: icGREP/icgrep-devel/icgrep/pablo/symbol_generator.h @ 5298

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

Start of work to simplify kernel writing. Removed generateDoBlockLogic method.

File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2014 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 SYMBOL_GENERATOR_H
8#define SYMBOL_GENERATOR_H
9
10#include <pablo/pabloAST.h>
11#include <llvm/ADT/StringMap.h>
12#include <boost/container/flat_map.hpp>
13
14namespace IDISA { class IDISA_Builder; }
15namespace pablo { class String; }
16namespace pablo { class Integer; }
17
18namespace pablo {
19
20class SymbolGenerator {
21    friend class PabloKernel;
22    using Allocator = PabloAST::Allocator;
23public:
24    using IntTy = int64_t;
25    String * makeString(const llvm::StringRef prefix, IDISA::IDISA_Builder * builder) noexcept;
26    Integer * getInteger(const IntTy value, IDISA::IDISA_Builder * builder) noexcept;
27    ~SymbolGenerator() { }
28protected:
29    SymbolGenerator(Allocator & allocator) : mAllocator(allocator) { }
30private:
31    Allocator &                                  mAllocator;
32    llvm::StringMap<IntTy>                       mPrefixMap;
33    llvm::StringMap<String *>                    mStringMap;
34    boost::container::flat_map<IntTy, Integer *> mIntegerMap;
35};
36
37
38}
39
40#endif // SYMBOL_GENERATOR_H
Note: See TracBrowser for help on using the repository browser.