BlSymTable.h 640 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "../Beef/BfCommon.h"
  3. #include <unordered_map>
  4. #include "BeefySysLib/util/Hash.h"
  5. //#define BL_USE_DENSEMAP_SYMTAB
  6. #ifdef BL_USE_DENSEMAP_SYMTAB
  7. #include <sparsehash/dense_hash_map>
  8. #include <sparsehash/dense_hash_set>
  9. #endif
  10. NS_BF_BEGIN
  11. class BlContext;
  12. class BlSymbol;
  13. class BlSymTable
  14. {
  15. public:
  16. BlContext* mContext;
  17. #ifdef BL_USE_DENSEMAP_SYMTAB
  18. google::dense_hash_map<Val128, BlSymbol*, Val128::Hash, Val128::Equals> mMap;
  19. #else
  20. std::unordered_map<Val128, BlSymbol*, Val128::Hash, Val128::Equals> mMap;
  21. #endif
  22. public:
  23. BlSymTable();
  24. BlSymbol* Add(const char* name, bool* isNew = NULL);
  25. };
  26. NS_BF_END