[clang] [clang][ssaf] Add EntityLinkage data structure (PR #181718)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 11:12:11 PST 2026


================
@@ -0,0 +1,50 @@
+//===- EntityLinkage.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_ENTITYLINKAGE_H
+#define LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_ENTITYLINKAGE_H
+
+namespace clang::ssaf {
+
+/// Represents the linkage properties of an entity in the program model.
+///
+/// EntityLinkage captures whether an entity has no linkage, internal linkage,
+/// or external linkage, which determines its visibility and accessibility
+/// across translation units.
+class EntityLinkage {
+  friend class SerializationFormat;
+
+public:
+  /// Specifies the type of linkage an entity has.
+  enum class LinkageType {
----------------
steakhal wrote:

This might feel controversial, but the `EntityLinkage` class already guards this enum.
We could get away using a raw enum here.
Otherwise what we currently have feels really awkward: `EntityLinkage::LinkageType::External`.
While `EntityLinkage::External` already conveys what it means.
```suggestion
  enum LinkageType {
```

https://github.com/llvm/llvm-project/pull/181718


More information about the cfe-commits mailing list