================ @@ -0,0 +1,52 @@ +//===- EntityIdTable.h ------------------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_ENTITY_ID_TABLE_H +#define LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_ENTITY_ID_TABLE_H + +#include "clang/Analysis/Scalable/Model/EntityId.h" +#include "clang/Analysis/Scalable/Model/EntityName.h" +#include <functional> +#include <map> + +namespace clang { +namespace ssaf { + +/// Manages entity name interning and provides efficient EntityId handles. +/// +/// The table maps each unique EntityName maps to exactly one EntityId. +/// Entities are never removed. +class EntityIdTable { + std::map<EntityName, EntityId> Entities; ---------------- Xazax-hun wrote:
We expect to scale to a large number of entities, right? Should this be a hash table instead? https://github.com/llvm/llvm-project/pull/171660 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
