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

Last change on this file since 4771 was 4692, checked in by nmedfort, 4 years ago

Temporary check in.

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