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

Last change on this file since 4543 was 4510, checked in by nmedfort, 5 years ago

Many memory deallocation fixes.

File size: 1.0 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 <string>
12#include <unordered_map>
13#include <llvm/ADT/Twine.h>
14#include <llvm/ADT/StringMap.h>
15#include <llvm/Support/StringPool.h>
16
17namespace pablo {
18
19class String;
20class Integer;
21
22class SymbolGenerator {
23    friend class PabloBlock;
24    using Twine = llvm::Twine;
25public:
26    typedef u_int64_t integer_t;
27    String * get(const std::string name, const bool generated = true);
28    String * make(const std::string prefix, const bool generated = true);
29    Integer * getInteger(const integer_t value);
30    SymbolGenerator();
31    ~SymbolGenerator();
32private:
33    std::unordered_map<std::string, integer_t>  mPrefixMap;
34    std::unordered_map<std::string, String *>   mStringMap;
35    std::unordered_map<integer_t, Integer *>    mIntegerMap;
36};
37
38}
39
40#endif // SYMBOL_GENERATOR_H
Note: See TracBrowser for help on using the repository browser.