55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
8+ //
9+ // This file defines BuildNamespace and NestedBuildNamespace classes that
10+ // represent build namespaces in the Scalable Static Analysis Framework.
11+ //
12+ // Build namespaces provide an abstraction for grouping program entities (such
13+ // as those in a shared library or compilation unit) to enable analysis of
14+ // software projects constructed from individual components.
15+ //
16+ // ===----------------------------------------------------------------------===//
817
918#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_BUILDNAMESPACE_H
1019#define LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_BUILDNAMESPACE_H
@@ -26,7 +35,16 @@ llvm::StringRef toString(BuildNamespaceKind BNK);
2635
2736std::optional<BuildNamespaceKind> parseBuildNamespaceKind (llvm::StringRef Str);
2837
29- // / Represents a single step in the build process.
38+ // / Represents a single namespace in the build process.
39+ // /
40+ // / A BuildNamespace groups program entities, such as those belonging to a
41+ // / compilation unit or link unit (e.g., a shared library). Each namespace has a
42+ // / kind (CompilationUnit or LinkUnit) and a unique identifier name within that
43+ // / kind.
44+ // /
45+ // / BuildNamespaces can be composed into NestedBuildNamespace to represent
46+ // / hierarchical namespace structures that model how software is constructed from
47+ // / its components.
3048class BuildNamespace {
3149 BuildNamespaceKind Kind;
3250 std::string Name;
@@ -46,7 +64,15 @@ class BuildNamespace {
4664 friend class SerializationFormat ;
4765};
4866
49- // / Represents a sequence of steps in the build process.
67+ // / Represents a hierarchical sequence of build namespaces.
68+ // /
69+ // / A NestedBuildNamespace captures namespace qualification for program entities
70+ // / by maintaining an ordered sequence of BuildNamespace steps. This models how
71+ // / entities are organized through multiple steps of the build process, such as
72+ // / first being part of a compilation unit, then incorporated into a link unit.
73+ // /
74+ // / For example, an entity might be qualified by a compilation unit namespace
75+ // / followed by a shared library namespace.
5076class NestedBuildNamespace {
5177 friend class SerializationFormat ;
5278
0 commit comments