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

Last change on this file since 4414 was 4410, checked in by nmedfort, 5 years ago

Changes to support 3-operand form for all instructions. CSE disabled but partially redundant now.

File size: 812 bytes
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
14namespace pablo {
15
16class String;
17
18class SymbolGenerator {
19    friend class PabloBlock;
20public:
21    String * get(const std::string name);
22    String * make(const std::string prefix);
23protected:
24    SymbolGenerator();
25    void* operator new (std::size_t size) noexcept {
26        return PabloAST::mAllocator.allocate(size);
27    }
28private:
29    std::unordered_map<std::string, unsigned>   mPrefixMap;
30    std::unordered_map<std::string, String *>   mStringMap;
31};
32
33}
34
35#endif // SYMBOL_GENERATOR_H
Note: See TracBrowser for help on using the repository browser.