================ @@ -0,0 +1,84 @@ +//===- BuildNamespace.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_BUILD_NAMESPACE_H +#define LLVM_CLANG_ANALYSIS_SCALABLE_BUILD_NAMESPACE_H + +#include "llvm/ADT/StringRef.h" +#include <optional> +#include <string> +#include <vector> + +namespace clang { +namespace ssaf { + +enum class BuildNamespaceKind : unsigned short { + CompilationUnit, + LinkUnit +}; + +std::string toString(BuildNamespaceKind BNK); + +std::optional<BuildNamespaceKind> parseBuildNamespaceKind(llvm::StringRef Str); + +/// Represents a single step in the build process. +class BuildNamespace { + BuildNamespaceKind Kind; + std::string Name; +public: + BuildNamespace(BuildNamespaceKind Kind, llvm::StringRef Name) + : Kind(Kind), Name(Name.str()) {} + + static BuildNamespace makeTU(llvm::StringRef CompilationId); + + bool operator==(const BuildNamespace& Other) const; + bool operator!=(const BuildNamespace& Other) const; + bool operator<(const BuildNamespace& Other) const; + + friend class SerializationFormat; +}; + +/// Represents a sequence of steps in the build process. ---------------- Xazax-hun wrote:
Is it important to preserve the information what entities belong to the same step or could a `NestedBuildNamespace` be not a different type just the result of merging some `BuildNamespace`s? https://github.com/llvm/llvm-project/pull/169131 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
