Skip to content

Conversation

usx95
Copy link
Contributor

@usx95 usx95 commented Oct 8, 2025

Restructure the C++ Lifetime Safety Analysis into modular components with clear separation of concerns.

This PR reorganizes the C++ Lifetime Safety Analysis code by:

  1. Breaking up the monolithic LifetimeSafety.cpp (1500+ lines) into multiple smaller, focused files
  2. Creating a dedicated LifetimeSafety directory with a clean component structure
  3. Introducing header files for each component with proper documentation
  4. Moving existing code into the appropriate component files:
    • Checker.h/cpp: Core lifetime checking logic
    • Dataflow.h: Generic dataflow analysis framework
    • Facts.h: Lifetime-relevant events and fact management
    • FactsGenerator.h/cpp: AST traversal for fact generation
    • LiveOrigins.h/cpp: Backward dataflow analysis for origin liveness
    • LoanPropagation.h/cpp: Forward dataflow analysis for loan tracking
    • Loans.h: Loan and access path definitions
    • Origins.h: Origin management
    • Reporter.h: Interface for reporting lifetime violations
    • Utils.h: Common utilities for the analysis

The code functionality remains the same, but is now better organized with clearer interfaces between components.

Copy link
Contributor Author

usx95 commented Oct 8, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Oct 8, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@usx95 usx95 force-pushed the users/usx95/10-08-_lifetimesafety_refactor_the_analysis_into_smaller_files branch 5 times, most recently from 663d9c3 to 76f9e5c Compare October 8, 2025 19:46
@usx95 usx95 force-pushed the users/usx95/10-08-_lifetimesafety_refactor_the_analysis_into_smaller_files branch 2 times, most recently from f31d078 to 1aeea3f Compare October 8, 2025 21:27
Apply changes from code browser
@usx95 usx95 force-pushed the users/usx95/10-08-_lifetimesafety_refactor_the_analysis_into_smaller_files branch from 1aeea3f to 98bb91d Compare October 8, 2025 21:29
@usx95 usx95 changed the title [LifetimeSafety] Refactor the analysis into smaller files [LifetimeSafety] Reorganize code into modular components Oct 9, 2025
@usx95 usx95 marked this pull request as ready for review October 9, 2025 08:26
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:analysis clang:temporal-safety Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr) labels Oct 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 9, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-analysis

Author: Utkarsh Saxena (usx95)

Changes

Restructure the C++ Lifetime Safety Analysis into modular components with clear separation of concerns.

This PR reorganizes the C++ Lifetime Safety Analysis code by:

  1. Breaking up the monolithic LifetimeSafety.cpp (1500+ lines) into multiple smaller, focused files
  2. Creating a dedicated LifetimeSafety directory with a clean component structure
  3. Introducing header files for each component with proper documentation
  4. Moving existing code into the appropriate component files:
    • Checker.h/cpp: Core lifetime checking logic
    • Dataflow.h: Generic dataflow analysis framework
    • Facts.h: Lifetime-relevant events and fact management
    • FactsGenerator.h/cpp: AST traversal for fact generation
    • LiveOrigins.h/cpp: Backward dataflow analysis for origin liveness
    • LoanPropagation.h/cpp: Forward dataflow analysis for loan tracking
    • Loans.h: Loan and access path definitions
    • Origins.h: Origin management
    • Reporter.h: Interface for reporting lifetime violations
    • Utils.h: Common utilities for the analysis

The code functionality remains the same, but is now better organized with clearer interfaces between components.


Patch is 150.46 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/162474.diff

27 Files Affected:

  • (modified) .github/new-prs-labeler.yml (+2-2)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h (+38)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h (+190)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h (+272)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h (+108)
  • (renamed) clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h ()
  • (renamed) clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeSafety.h (+14-98)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/LiveOrigins.h (+138)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h (+97)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h (+85)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Origins.h (+151)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Reporter.h (+38)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h (+123)
  • (modified) clang/lib/Analysis/CMakeLists.txt (+1-2)
  • (removed) clang/lib/Analysis/LifetimeSafety.cpp (-1546)
  • (added) clang/lib/Analysis/LifetimeSafety/CMakeLists.txt (+9)
  • (added) clang/lib/Analysis/LifetimeSafety/Checker.cpp (+145)
  • (added) clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp (+340)
  • (renamed) clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp (+1-1)
  • (added) clang/lib/Analysis/LifetimeSafety/LifetimeSafety.cpp (+134)
  • (added) clang/lib/Analysis/LifetimeSafety/LiveOrigins.cpp (+109)
  • (added) clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp (+63)
  • (modified) clang/lib/Sema/AnalysisBasedWarnings.cpp (+1-1)
  • (modified) clang/lib/Sema/CMakeLists.txt (+1)
  • (modified) clang/lib/Sema/CheckExprLifetime.cpp (+1-1)
  • (modified) clang/lib/Sema/SemaAPINotes.cpp (+1-1)
  • (modified) clang/unittests/Analysis/LifetimeSafetyTest.cpp (+1-1)
diff --git a/.github/new-prs-labeler.yml b/.github/new-prs-labeler.yml
index c49fd1dd3cc7f..efdc42d349195 100644
--- a/.github/new-prs-labeler.yml
+++ b/.github/new-prs-labeler.yml
@@ -1096,8 +1096,8 @@ clang:openmp:
   - llvm/test/Transforms/OpenMP/**
 
 clang:temporal-safety:
-  - clang/include/clang/Analysis/Analyses/LifetimeSafety*
-  - clang/lib/Analysis/LifetimeSafety*
+  - clang/include/clang/Analysis/Analyses/LifetimeSafety/**
+  - clang/lib/Analysis/LifetimeSafety/**
   - clang/unittests/Analysis/LifetimeSafety*
   - clang/test/Sema/*lifetime-safety*
   - clang/test/Sema/*lifetime-analysis*
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h
new file mode 100644
index 0000000000000..b059e00d7bdaf
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h
@@ -0,0 +1,38 @@
+//===- Checker.h - C++ Lifetime Safety Analysis -*----------- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides the entry point for lifetime checking, which detects
+// use-after-free errors by checking if live origins hold loans that have
+// expired.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_CHECKER_H
+#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_CHECKER_H
+
+#include "clang/Analysis/Analyses/LifetimeSafety/Facts.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/LiveOrigins.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/Reporter.h"
+
+namespace clang {
+namespace lifetimes {
+namespace internal {
+
+/// Runs the lifetime checker, which detects use-after-free errors by
+/// examining loan expiration points and checking if any live origins hold
+/// the expired loan.
+void runLifetimeChecker(LoanPropagationAnalysis &LoanPropagation,
+                        LiveOriginAnalysis &LiveOrigins, FactManager &FactMgr,
+                        AnalysisDeclContext &ADC,
+                        LifetimeSafetyReporter *Reporter);
+
+} // namespace internal
+} // namespace lifetimes
+} // namespace clang
+
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_CHECKER_H
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h
new file mode 100644
index 0000000000000..e818b26739e18
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h
@@ -0,0 +1,190 @@
+//===- Dataflow.h - Generic Dataflow Analysis Framework --------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines a generic, policy-based driver for dataflow analyses.
+// It provides a flexible framework that combines the dataflow runner and
+// transfer functions, allowing derived classes to implement specific analyses
+// by defining their lattice, join, and transfer functions.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_DATAFLOW_H
+#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_DATAFLOW_H
+
+#include "clang/Analysis/Analyses/LifetimeSafety/Facts.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/TimeProfiler.h"
+#include <optional>
+
+namespace clang::lifetimes {
+namespace internal {
+
+enum class Direction { Forward, Backward };
+
+/// A `ProgramPoint` identifies a location in the CFG by pointing to a specific
+/// `Fact`. identified by a lifetime-related event (`Fact`).
+///
+/// A `ProgramPoint` has "after" semantics: it represents the location
+/// immediately after its corresponding `Fact`.
+using ProgramPoint = const Fact *;
+
+/// A generic, policy-based driver for dataflow analyses. It combines
+/// the dataflow runner and the transferer logic into a single class hierarchy.
+///
+/// The derived class is expected to provide:
+/// - A `Lattice` type.
+/// - `StringRef getAnalysisName() const`
+/// - `Lattice getInitialState();` The initial state of the analysis.
+/// - `Lattice join(Lattice, Lattice);` Merges states from multiple CFG paths.
+/// - `Lattice transfer(Lattice, const FactType&);` Defines how a single
+///   lifetime-relevant `Fact` transforms the lattice state. Only overloads
+///   for facts relevant to the analysis need to be implemented.
+///
+/// \tparam Derived The CRTP derived class that implements the specific
+/// analysis.
+/// \tparam LatticeType The dataflow lattice used by the analysis.
+/// \tparam Dir The direction of the analysis (Forward or Backward).
+/// TODO: Maybe use the dataflow framework! The framework might need changes
+/// to support the current comparison done at block-entry.
+template <typename Derived, typename LatticeType, Direction Dir>
+class DataflowAnalysis {
+public:
+  using Lattice = LatticeType;
+  using Base = DataflowAnalysis<Derived, Lattice, Dir>;
+
+private:
+  const CFG &Cfg;
+  AnalysisDeclContext &AC;
+
+  /// The dataflow state before a basic block is processed.
+  llvm::DenseMap<const CFGBlock *, Lattice> InStates;
+  /// The dataflow state after a basic block is processed.
+  llvm::DenseMap<const CFGBlock *, Lattice> OutStates;
+  /// The dataflow state at a Program Point.
+  /// In a forward analysis, this is the state after the Fact at that point has
+  /// been applied, while in a backward analysis, it is the state before.
+  llvm::DenseMap<ProgramPoint, Lattice> PerPointStates;
+
+  static constexpr bool isForward() { return Dir == Direction::Forward; }
+
+protected:
+  FactManager &AllFacts;
+
+  explicit DataflowAnalysis(const CFG &C, AnalysisDeclContext &AC,
+                            FactManager &F)
+      : Cfg(C), AC(AC), AllFacts(F) {}
+
+public:
+  void run() {
+    Derived &D = static_cast<Derived &>(*this);
+    llvm::TimeTraceScope Time(D.getAnalysisName());
+
+    using Worklist =
+        std::conditional_t<Dir == Direction::Forward, ForwardDataflowWorklist,
+                           BackwardDataflowWorklist>;
+    Worklist W(Cfg, AC);
+
+    const CFGBlock *Start = isForward() ? &Cfg.getEntry() : &Cfg.getExit();
+    InStates[Start] = D.getInitialState();
+    W.enqueueBlock(Start);
+
+    while (const CFGBlock *B = W.dequeue()) {
+      Lattice StateIn = *getInState(B);
+      Lattice StateOut = transferBlock(B, StateIn);
+      OutStates[B] = StateOut;
+      for (const CFGBlock *AdjacentB : isForward() ? B->succs() : B->preds()) {
+        if (!AdjacentB)
+          continue;
+        std::optional<Lattice> OldInState = getInState(AdjacentB);
+        Lattice NewInState =
+            !OldInState ? StateOut : D.join(*OldInState, StateOut);
+        // Enqueue the adjacent block if its in-state has changed or if we have
+        // never seen it.
+        if (!OldInState || NewInState != *OldInState) {
+          InStates[AdjacentB] = NewInState;
+          W.enqueueBlock(AdjacentB);
+        }
+      }
+    }
+  }
+
+protected:
+  Lattice getState(ProgramPoint P) const { return PerPointStates.lookup(P); }
+
+  std::optional<Lattice> getInState(const CFGBlock *B) const {
+    auto It = InStates.find(B);
+    if (It == InStates.end())
+      return std::nullopt;
+    return It->second;
+  }
+
+  Lattice getOutState(const CFGBlock *B) const { return OutStates.lookup(B); }
+
+  void dump() const {
+    const Derived *D = static_cast<const Derived *>(this);
+    llvm::dbgs() << "==========================================\n";
+    llvm::dbgs() << D->getAnalysisName() << " results:\n";
+    llvm::dbgs() << "==========================================\n";
+    const CFGBlock &B = isForward() ? Cfg.getExit() : Cfg.getEntry();
+    getOutState(&B).dump(llvm::dbgs());
+  }
+
+private:
+  /// Computes the state at one end of a block by applying all its facts
+  /// sequentially to a given state from the other end.
+  Lattice transferBlock(const CFGBlock *Block, Lattice State) {
+    auto Facts = AllFacts.getFacts(Block);
+    if constexpr (isForward()) {
+      for (const Fact *F : Facts) {
+        State = transferFact(State, F);
+        PerPointStates[F] = State;
+      }
+    } else {
+      for (const Fact *F : llvm::reverse(Facts)) {
+        // In backward analysis, capture the state before applying the fact.
+        PerPointStates[F] = State;
+        State = transferFact(State, F);
+      }
+    }
+    return State;
+  }
+
+  Lattice transferFact(Lattice In, const Fact *F) {
+    assert(F);
+    Derived *D = static_cast<Derived *>(this);
+    switch (F->getKind()) {
+    case Fact::Kind::Issue:
+      return D->transfer(In, *F->getAs<IssueFact>());
+    case Fact::Kind::Expire:
+      return D->transfer(In, *F->getAs<ExpireFact>());
+    case Fact::Kind::OriginFlow:
+      return D->transfer(In, *F->getAs<OriginFlowFact>());
+    case Fact::Kind::ReturnOfOrigin:
+      return D->transfer(In, *F->getAs<ReturnOfOriginFact>());
+    case Fact::Kind::Use:
+      return D->transfer(In, *F->getAs<UseFact>());
+    case Fact::Kind::TestPoint:
+      return D->transfer(In, *F->getAs<TestPointFact>());
+    }
+    llvm_unreachable("Unknown fact kind");
+  }
+
+public:
+  Lattice transfer(Lattice In, const IssueFact &) { return In; }
+  Lattice transfer(Lattice In, const ExpireFact &) { return In; }
+  Lattice transfer(Lattice In, const OriginFlowFact &) { return In; }
+  Lattice transfer(Lattice In, const ReturnOfOriginFact &) { return In; }
+  Lattice transfer(Lattice In, const UseFact &) { return In; }
+  Lattice transfer(Lattice In, const TestPointFact &) { return In; }
+};
+} // namespace internal
+} // namespace clang::lifetimes
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_DATAFLOW_H
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
new file mode 100644
index 0000000000000..5cfc1ed67c406
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
@@ -0,0 +1,272 @@
+//===- Facts.h - Lifetime Analysis Facts and Fact Manager ------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines Facts, which are atomic lifetime-relevant events (such as
+// loan issuance, loan expiration, origin flow, and use), and the FactManager,
+// which manages the storage and retrieval of facts for each CFG block.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_FACTS_H
+#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_FACTS_H
+
+#include "clang/Analysis/Analyses/LifetimeSafety/Loans.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/Origins.h"
+#include "clang/Analysis/Analyses/PostOrderCFGView.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Debug.h"
+#include <cstdint>
+
+namespace clang::lifetimes {
+namespace internal {
+/// An abstract base class for a single, atomic lifetime-relevant event.
+class Fact {
+
+public:
+  enum class Kind : uint8_t {
+    /// A new loan is issued from a borrow expression (e.g., &x).
+    Issue,
+    /// A loan expires as its underlying storage is freed (e.g., variable goes
+    /// out of scope).
+    Expire,
+    /// An origin is propagated from a source to a destination (e.g., p = q).
+    /// This can also optionally kill the destination origin before flowing into
+    /// it. Otherwise, the source's loan set is merged into the destination's
+    /// loan set.
+    OriginFlow,
+    /// An origin escapes the function by flowing into the return value.
+    ReturnOfOrigin,
+    /// An origin is used (eg. appears as l-value expression like DeclRefExpr).
+    Use,
+    /// A marker for a specific point in the code, for testing.
+    TestPoint,
+  };
+
+private:
+  Kind K;
+
+protected:
+  Fact(Kind K) : K(K) {}
+
+public:
+  virtual ~Fact() = default;
+  Kind getKind() const { return K; }
+
+  template <typename T> const T *getAs() const {
+    if (T::classof(this))
+      return static_cast<const T *>(this);
+    return nullptr;
+  }
+
+  virtual void dump(llvm::raw_ostream &OS, const LoanManager &,
+                    const OriginManager &) const {
+    OS << "Fact (Kind: " << static_cast<int>(K) << ")\n";
+  }
+};
+
+/// A `ProgramPoint` identifies a location in the CFG by pointing to a specific
+/// `Fact`. identified by a lifetime-related event (`Fact`).
+///
+/// A `ProgramPoint` has "after" semantics: it represents the location
+/// immediately after its corresponding `Fact`.
+using ProgramPoint = const Fact *;
+
+class IssueFact : public Fact {
+  LoanID LID;
+  OriginID OID;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::Issue; }
+
+  IssueFact(LoanID LID, OriginID OID) : Fact(Kind::Issue), LID(LID), OID(OID) {}
+  LoanID getLoanID() const { return LID; }
+  OriginID getOriginID() const { return OID; }
+  void dump(llvm::raw_ostream &OS, const LoanManager &LM,
+            const OriginManager &OM) const override {
+    OS << "Issue (";
+    LM.getLoan(getLoanID()).dump(OS);
+    OS << ", ToOrigin: ";
+    OM.dump(getOriginID(), OS);
+    OS << ")\n";
+  }
+};
+
+class ExpireFact : public Fact {
+  LoanID LID;
+  SourceLocation ExpiryLoc;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::Expire; }
+
+  ExpireFact(LoanID LID, SourceLocation ExpiryLoc)
+      : Fact(Kind::Expire), LID(LID), ExpiryLoc(ExpiryLoc) {}
+
+  LoanID getLoanID() const { return LID; }
+  SourceLocation getExpiryLoc() const { return ExpiryLoc; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &LM,
+            const OriginManager &) const override {
+    OS << "Expire (";
+    LM.getLoan(getLoanID()).dump(OS);
+    OS << ")\n";
+  }
+};
+
+class OriginFlowFact : public Fact {
+  OriginID OIDDest;
+  OriginID OIDSrc;
+  // True if the destination origin should be killed (i.e., its current loans
+  // cleared) before the source origin's loans are flowed into it.
+  bool KillDest;
+
+public:
+  static bool classof(const Fact *F) {
+    return F->getKind() == Kind::OriginFlow;
+  }
+
+  OriginFlowFact(OriginID OIDDest, OriginID OIDSrc, bool KillDest)
+      : Fact(Kind::OriginFlow), OIDDest(OIDDest), OIDSrc(OIDSrc),
+        KillDest(KillDest) {}
+
+  OriginID getDestOriginID() const { return OIDDest; }
+  OriginID getSrcOriginID() const { return OIDSrc; }
+  bool getKillDest() const { return KillDest; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &OM) const override {
+    OS << "OriginFlow (Dest: ";
+    OM.dump(getDestOriginID(), OS);
+    OS << ", Src: ";
+    OM.dump(getSrcOriginID(), OS);
+    OS << (getKillDest() ? "" : ", Merge");
+    OS << ")\n";
+  }
+};
+
+class ReturnOfOriginFact : public Fact {
+  OriginID OID;
+
+public:
+  static bool classof(const Fact *F) {
+    return F->getKind() == Kind::ReturnOfOrigin;
+  }
+
+  ReturnOfOriginFact(OriginID OID) : Fact(Kind::ReturnOfOrigin), OID(OID) {}
+  OriginID getReturnedOriginID() const { return OID; }
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &OM) const override {
+    OS << "ReturnOfOrigin (";
+    OM.dump(getReturnedOriginID(), OS);
+    OS << ")\n";
+  }
+};
+
+class UseFact : public Fact {
+  const Expr *UseExpr;
+  // True if this use is a write operation (e.g., left-hand side of assignment).
+  // Write operations are exempted from use-after-free checks.
+  bool IsWritten = false;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::Use; }
+
+  UseFact(const Expr *UseExpr) : Fact(Kind::Use), UseExpr(UseExpr) {}
+
+  OriginID getUsedOrigin(const OriginManager &OM) const {
+    // TODO: Remove const cast and make OriginManager::get as const.
+    return const_cast<OriginManager &>(OM).get(*UseExpr);
+  }
+  const Expr *getUseExpr() const { return UseExpr; }
+  void markAsWritten() { IsWritten = true; }
+  bool isWritten() const { return IsWritten; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &OM) const override {
+    OS << "Use (";
+    OM.dump(getUsedOrigin(OM), OS);
+    OS << ", " << (isWritten() ? "Write" : "Read") << ")\n";
+  }
+};
+
+/// A dummy-fact used to mark a specific point in the code for testing.
+/// It is generated by recognizing a `void("__lifetime_test_point_...")` cast.
+class TestPointFact : public Fact {
+  StringRef Annotation;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::TestPoint; }
+
+  explicit TestPointFact(StringRef Annotation)
+      : Fact(Kind::TestPoint), Annotation(Annotation) {}
+
+  StringRef getAnnotation() const { return Annotation; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &) const override {
+    OS << "TestPoint (Annotation: \"" << getAnnotation() << "\")\n";
+  }
+};
+
+class FactManager {
+public:
+  llvm::ArrayRef<const Fact *> getFacts(const CFGBlock *B) const {
+    auto It = BlockToFactsMap.find(B);
+    if (It != BlockToFactsMap.end())
+      return It->second;
+    return {};
+  }
+
+  void addBlockFacts(const CFGBlock *B, llvm::ArrayRef<Fact *> NewFacts) {
+    if (!NewFacts.empty())
+      BlockToFactsMap[B].assign(NewFacts.begin(), NewFacts.end());
+  }
+
+  template <typename FactType, typename... Args>
+  FactType *createFact(Args &&...args) {
+    void *Mem = FactAllocator.Allocate<FactType>();
+    return new (Mem) FactType(std::forward<Args>(args)...);
+  }
+
+  void dump(const CFG &Cfg, AnalysisDeclContext &AC) const {
+    llvm::dbgs() << "==========================================\n";
+    llvm::dbgs() << "       Lifetime Analysis Facts:\n";
+    llvm::dbgs() << "==========================================\n";
+    if (const Decl *D = AC.getDecl())
+      if (const auto *ND = dyn_cast<NamedDecl>(D))
+        llvm::dbgs() << "Function: " << ND->getQualifiedNameAsString() << "\n";
+    // Print blocks in the order as they appear in code for a stable ordering.
+    for (const CFGBlock *B : *AC.getAnalysis<PostOrderCFGView>()) {
+      llvm::dbgs() << "  Block B" << B->getBlockID() << ":\n";
+      auto It = BlockToFactsMap.find(B);
+      if (It != BlockToFactsMap.end()) {
+        for (const Fact *F : It->second) {
+          llvm::dbgs() << "    ";
+          F->dump(llvm::dbgs(), LoanMgr, OriginMgr);
+        }
+      }
+      llvm::dbgs() << "  End of Block\n";
+    }
+  }
+
+  LoanManager &getLoanMgr() { return LoanMgr; }
+  const LoanManager &getLoanMgr() const { return LoanMgr; }
+  OriginManager &getOriginMgr() { return OriginMgr; }
+  const OriginManager &getOriginMgr() const { return OriginMgr; }
+
+private:
+  LoanManager LoanMgr;
+  OriginManager OriginMgr;
+  llvm::DenseMap<const clang::CFGBlock *, llvm::SmallVector<const Fact *>>
+      BlockToFactsMap;
+  llvm::BumpPtrAllocator FactAllocator;
+};
+} // namespace internal
+} // namespace clang::lifetimes
+
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_FACTS_H
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
new file mode 100644
index 0000000000000..a904f3dc64a06
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
@@ -0,0 +1,108 @@
+//===- FactsGenerator.h - Lifetime Facts Generation -------------*- C++ -*-=...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented Oct 9, 2025

@llvm/pr-subscribers-clang-temporal-safety

Author: Utkarsh Saxena (usx95)

Changes

Restructure the C++ Lifetime Safety Analysis into modular components with clear separation of concerns.

This PR reorganizes the C++ Lifetime Safety Analysis code by:

  1. Breaking up the monolithic LifetimeSafety.cpp (1500+ lines) into multiple smaller, focused files
  2. Creating a dedicated LifetimeSafety directory with a clean component structure
  3. Introducing header files for each component with proper documentation
  4. Moving existing code into the appropriate component files:
    • Checker.h/cpp: Core lifetime checking logic
    • Dataflow.h: Generic dataflow analysis framework
    • Facts.h: Lifetime-relevant events and fact management
    • FactsGenerator.h/cpp: AST traversal for fact generation
    • LiveOrigins.h/cpp: Backward dataflow analysis for origin liveness
    • LoanPropagation.h/cpp: Forward dataflow analysis for loan tracking
    • Loans.h: Loan and access path definitions
    • Origins.h: Origin management
    • Reporter.h: Interface for reporting lifetime violations
    • Utils.h: Common utilities for the analysis

The code functionality remains the same, but is now better organized with clearer interfaces between components.


Patch is 150.46 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/162474.diff

27 Files Affected:

  • (modified) .github/new-prs-labeler.yml (+2-2)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h (+38)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h (+190)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h (+272)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h (+108)
  • (renamed) clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h ()
  • (renamed) clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeSafety.h (+14-98)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/LiveOrigins.h (+138)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h (+97)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Loans.h (+85)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Origins.h (+151)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Reporter.h (+38)
  • (added) clang/include/clang/Analysis/Analyses/LifetimeSafety/Utils.h (+123)
  • (modified) clang/lib/Analysis/CMakeLists.txt (+1-2)
  • (removed) clang/lib/Analysis/LifetimeSafety.cpp (-1546)
  • (added) clang/lib/Analysis/LifetimeSafety/CMakeLists.txt (+9)
  • (added) clang/lib/Analysis/LifetimeSafety/Checker.cpp (+145)
  • (added) clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp (+340)
  • (renamed) clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp (+1-1)
  • (added) clang/lib/Analysis/LifetimeSafety/LifetimeSafety.cpp (+134)
  • (added) clang/lib/Analysis/LifetimeSafety/LiveOrigins.cpp (+109)
  • (added) clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp (+63)
  • (modified) clang/lib/Sema/AnalysisBasedWarnings.cpp (+1-1)
  • (modified) clang/lib/Sema/CMakeLists.txt (+1)
  • (modified) clang/lib/Sema/CheckExprLifetime.cpp (+1-1)
  • (modified) clang/lib/Sema/SemaAPINotes.cpp (+1-1)
  • (modified) clang/unittests/Analysis/LifetimeSafetyTest.cpp (+1-1)
diff --git a/.github/new-prs-labeler.yml b/.github/new-prs-labeler.yml
index c49fd1dd3cc7f..efdc42d349195 100644
--- a/.github/new-prs-labeler.yml
+++ b/.github/new-prs-labeler.yml
@@ -1096,8 +1096,8 @@ clang:openmp:
   - llvm/test/Transforms/OpenMP/**
 
 clang:temporal-safety:
-  - clang/include/clang/Analysis/Analyses/LifetimeSafety*
-  - clang/lib/Analysis/LifetimeSafety*
+  - clang/include/clang/Analysis/Analyses/LifetimeSafety/**
+  - clang/lib/Analysis/LifetimeSafety/**
   - clang/unittests/Analysis/LifetimeSafety*
   - clang/test/Sema/*lifetime-safety*
   - clang/test/Sema/*lifetime-analysis*
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h
new file mode 100644
index 0000000000000..b059e00d7bdaf
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Checker.h
@@ -0,0 +1,38 @@
+//===- Checker.h - C++ Lifetime Safety Analysis -*----------- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides the entry point for lifetime checking, which detects
+// use-after-free errors by checking if live origins hold loans that have
+// expired.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_CHECKER_H
+#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_CHECKER_H
+
+#include "clang/Analysis/Analyses/LifetimeSafety/Facts.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/LiveOrigins.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/LoanPropagation.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/Reporter.h"
+
+namespace clang {
+namespace lifetimes {
+namespace internal {
+
+/// Runs the lifetime checker, which detects use-after-free errors by
+/// examining loan expiration points and checking if any live origins hold
+/// the expired loan.
+void runLifetimeChecker(LoanPropagationAnalysis &LoanPropagation,
+                        LiveOriginAnalysis &LiveOrigins, FactManager &FactMgr,
+                        AnalysisDeclContext &ADC,
+                        LifetimeSafetyReporter *Reporter);
+
+} // namespace internal
+} // namespace lifetimes
+} // namespace clang
+
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_CHECKER_H
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h
new file mode 100644
index 0000000000000..e818b26739e18
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Dataflow.h
@@ -0,0 +1,190 @@
+//===- Dataflow.h - Generic Dataflow Analysis Framework --------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines a generic, policy-based driver for dataflow analyses.
+// It provides a flexible framework that combines the dataflow runner and
+// transfer functions, allowing derived classes to implement specific analyses
+// by defining their lattice, join, and transfer functions.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_DATAFLOW_H
+#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_DATAFLOW_H
+
+#include "clang/Analysis/Analyses/LifetimeSafety/Facts.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/TimeProfiler.h"
+#include <optional>
+
+namespace clang::lifetimes {
+namespace internal {
+
+enum class Direction { Forward, Backward };
+
+/// A `ProgramPoint` identifies a location in the CFG by pointing to a specific
+/// `Fact`. identified by a lifetime-related event (`Fact`).
+///
+/// A `ProgramPoint` has "after" semantics: it represents the location
+/// immediately after its corresponding `Fact`.
+using ProgramPoint = const Fact *;
+
+/// A generic, policy-based driver for dataflow analyses. It combines
+/// the dataflow runner and the transferer logic into a single class hierarchy.
+///
+/// The derived class is expected to provide:
+/// - A `Lattice` type.
+/// - `StringRef getAnalysisName() const`
+/// - `Lattice getInitialState();` The initial state of the analysis.
+/// - `Lattice join(Lattice, Lattice);` Merges states from multiple CFG paths.
+/// - `Lattice transfer(Lattice, const FactType&);` Defines how a single
+///   lifetime-relevant `Fact` transforms the lattice state. Only overloads
+///   for facts relevant to the analysis need to be implemented.
+///
+/// \tparam Derived The CRTP derived class that implements the specific
+/// analysis.
+/// \tparam LatticeType The dataflow lattice used by the analysis.
+/// \tparam Dir The direction of the analysis (Forward or Backward).
+/// TODO: Maybe use the dataflow framework! The framework might need changes
+/// to support the current comparison done at block-entry.
+template <typename Derived, typename LatticeType, Direction Dir>
+class DataflowAnalysis {
+public:
+  using Lattice = LatticeType;
+  using Base = DataflowAnalysis<Derived, Lattice, Dir>;
+
+private:
+  const CFG &Cfg;
+  AnalysisDeclContext &AC;
+
+  /// The dataflow state before a basic block is processed.
+  llvm::DenseMap<const CFGBlock *, Lattice> InStates;
+  /// The dataflow state after a basic block is processed.
+  llvm::DenseMap<const CFGBlock *, Lattice> OutStates;
+  /// The dataflow state at a Program Point.
+  /// In a forward analysis, this is the state after the Fact at that point has
+  /// been applied, while in a backward analysis, it is the state before.
+  llvm::DenseMap<ProgramPoint, Lattice> PerPointStates;
+
+  static constexpr bool isForward() { return Dir == Direction::Forward; }
+
+protected:
+  FactManager &AllFacts;
+
+  explicit DataflowAnalysis(const CFG &C, AnalysisDeclContext &AC,
+                            FactManager &F)
+      : Cfg(C), AC(AC), AllFacts(F) {}
+
+public:
+  void run() {
+    Derived &D = static_cast<Derived &>(*this);
+    llvm::TimeTraceScope Time(D.getAnalysisName());
+
+    using Worklist =
+        std::conditional_t<Dir == Direction::Forward, ForwardDataflowWorklist,
+                           BackwardDataflowWorklist>;
+    Worklist W(Cfg, AC);
+
+    const CFGBlock *Start = isForward() ? &Cfg.getEntry() : &Cfg.getExit();
+    InStates[Start] = D.getInitialState();
+    W.enqueueBlock(Start);
+
+    while (const CFGBlock *B = W.dequeue()) {
+      Lattice StateIn = *getInState(B);
+      Lattice StateOut = transferBlock(B, StateIn);
+      OutStates[B] = StateOut;
+      for (const CFGBlock *AdjacentB : isForward() ? B->succs() : B->preds()) {
+        if (!AdjacentB)
+          continue;
+        std::optional<Lattice> OldInState = getInState(AdjacentB);
+        Lattice NewInState =
+            !OldInState ? StateOut : D.join(*OldInState, StateOut);
+        // Enqueue the adjacent block if its in-state has changed or if we have
+        // never seen it.
+        if (!OldInState || NewInState != *OldInState) {
+          InStates[AdjacentB] = NewInState;
+          W.enqueueBlock(AdjacentB);
+        }
+      }
+    }
+  }
+
+protected:
+  Lattice getState(ProgramPoint P) const { return PerPointStates.lookup(P); }
+
+  std::optional<Lattice> getInState(const CFGBlock *B) const {
+    auto It = InStates.find(B);
+    if (It == InStates.end())
+      return std::nullopt;
+    return It->second;
+  }
+
+  Lattice getOutState(const CFGBlock *B) const { return OutStates.lookup(B); }
+
+  void dump() const {
+    const Derived *D = static_cast<const Derived *>(this);
+    llvm::dbgs() << "==========================================\n";
+    llvm::dbgs() << D->getAnalysisName() << " results:\n";
+    llvm::dbgs() << "==========================================\n";
+    const CFGBlock &B = isForward() ? Cfg.getExit() : Cfg.getEntry();
+    getOutState(&B).dump(llvm::dbgs());
+  }
+
+private:
+  /// Computes the state at one end of a block by applying all its facts
+  /// sequentially to a given state from the other end.
+  Lattice transferBlock(const CFGBlock *Block, Lattice State) {
+    auto Facts = AllFacts.getFacts(Block);
+    if constexpr (isForward()) {
+      for (const Fact *F : Facts) {
+        State = transferFact(State, F);
+        PerPointStates[F] = State;
+      }
+    } else {
+      for (const Fact *F : llvm::reverse(Facts)) {
+        // In backward analysis, capture the state before applying the fact.
+        PerPointStates[F] = State;
+        State = transferFact(State, F);
+      }
+    }
+    return State;
+  }
+
+  Lattice transferFact(Lattice In, const Fact *F) {
+    assert(F);
+    Derived *D = static_cast<Derived *>(this);
+    switch (F->getKind()) {
+    case Fact::Kind::Issue:
+      return D->transfer(In, *F->getAs<IssueFact>());
+    case Fact::Kind::Expire:
+      return D->transfer(In, *F->getAs<ExpireFact>());
+    case Fact::Kind::OriginFlow:
+      return D->transfer(In, *F->getAs<OriginFlowFact>());
+    case Fact::Kind::ReturnOfOrigin:
+      return D->transfer(In, *F->getAs<ReturnOfOriginFact>());
+    case Fact::Kind::Use:
+      return D->transfer(In, *F->getAs<UseFact>());
+    case Fact::Kind::TestPoint:
+      return D->transfer(In, *F->getAs<TestPointFact>());
+    }
+    llvm_unreachable("Unknown fact kind");
+  }
+
+public:
+  Lattice transfer(Lattice In, const IssueFact &) { return In; }
+  Lattice transfer(Lattice In, const ExpireFact &) { return In; }
+  Lattice transfer(Lattice In, const OriginFlowFact &) { return In; }
+  Lattice transfer(Lattice In, const ReturnOfOriginFact &) { return In; }
+  Lattice transfer(Lattice In, const UseFact &) { return In; }
+  Lattice transfer(Lattice In, const TestPointFact &) { return In; }
+};
+} // namespace internal
+} // namespace clang::lifetimes
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_DATAFLOW_H
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
new file mode 100644
index 0000000000000..5cfc1ed67c406
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h
@@ -0,0 +1,272 @@
+//===- Facts.h - Lifetime Analysis Facts and Fact Manager ------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines Facts, which are atomic lifetime-relevant events (such as
+// loan issuance, loan expiration, origin flow, and use), and the FactManager,
+// which manages the storage and retrieval of facts for each CFG block.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_FACTS_H
+#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_FACTS_H
+
+#include "clang/Analysis/Analyses/LifetimeSafety/Loans.h"
+#include "clang/Analysis/Analyses/LifetimeSafety/Origins.h"
+#include "clang/Analysis/Analyses/PostOrderCFGView.h"
+#include "clang/Analysis/AnalysisDeclContext.h"
+#include "clang/Analysis/CFG.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Debug.h"
+#include <cstdint>
+
+namespace clang::lifetimes {
+namespace internal {
+/// An abstract base class for a single, atomic lifetime-relevant event.
+class Fact {
+
+public:
+  enum class Kind : uint8_t {
+    /// A new loan is issued from a borrow expression (e.g., &x).
+    Issue,
+    /// A loan expires as its underlying storage is freed (e.g., variable goes
+    /// out of scope).
+    Expire,
+    /// An origin is propagated from a source to a destination (e.g., p = q).
+    /// This can also optionally kill the destination origin before flowing into
+    /// it. Otherwise, the source's loan set is merged into the destination's
+    /// loan set.
+    OriginFlow,
+    /// An origin escapes the function by flowing into the return value.
+    ReturnOfOrigin,
+    /// An origin is used (eg. appears as l-value expression like DeclRefExpr).
+    Use,
+    /// A marker for a specific point in the code, for testing.
+    TestPoint,
+  };
+
+private:
+  Kind K;
+
+protected:
+  Fact(Kind K) : K(K) {}
+
+public:
+  virtual ~Fact() = default;
+  Kind getKind() const { return K; }
+
+  template <typename T> const T *getAs() const {
+    if (T::classof(this))
+      return static_cast<const T *>(this);
+    return nullptr;
+  }
+
+  virtual void dump(llvm::raw_ostream &OS, const LoanManager &,
+                    const OriginManager &) const {
+    OS << "Fact (Kind: " << static_cast<int>(K) << ")\n";
+  }
+};
+
+/// A `ProgramPoint` identifies a location in the CFG by pointing to a specific
+/// `Fact`. identified by a lifetime-related event (`Fact`).
+///
+/// A `ProgramPoint` has "after" semantics: it represents the location
+/// immediately after its corresponding `Fact`.
+using ProgramPoint = const Fact *;
+
+class IssueFact : public Fact {
+  LoanID LID;
+  OriginID OID;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::Issue; }
+
+  IssueFact(LoanID LID, OriginID OID) : Fact(Kind::Issue), LID(LID), OID(OID) {}
+  LoanID getLoanID() const { return LID; }
+  OriginID getOriginID() const { return OID; }
+  void dump(llvm::raw_ostream &OS, const LoanManager &LM,
+            const OriginManager &OM) const override {
+    OS << "Issue (";
+    LM.getLoan(getLoanID()).dump(OS);
+    OS << ", ToOrigin: ";
+    OM.dump(getOriginID(), OS);
+    OS << ")\n";
+  }
+};
+
+class ExpireFact : public Fact {
+  LoanID LID;
+  SourceLocation ExpiryLoc;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::Expire; }
+
+  ExpireFact(LoanID LID, SourceLocation ExpiryLoc)
+      : Fact(Kind::Expire), LID(LID), ExpiryLoc(ExpiryLoc) {}
+
+  LoanID getLoanID() const { return LID; }
+  SourceLocation getExpiryLoc() const { return ExpiryLoc; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &LM,
+            const OriginManager &) const override {
+    OS << "Expire (";
+    LM.getLoan(getLoanID()).dump(OS);
+    OS << ")\n";
+  }
+};
+
+class OriginFlowFact : public Fact {
+  OriginID OIDDest;
+  OriginID OIDSrc;
+  // True if the destination origin should be killed (i.e., its current loans
+  // cleared) before the source origin's loans are flowed into it.
+  bool KillDest;
+
+public:
+  static bool classof(const Fact *F) {
+    return F->getKind() == Kind::OriginFlow;
+  }
+
+  OriginFlowFact(OriginID OIDDest, OriginID OIDSrc, bool KillDest)
+      : Fact(Kind::OriginFlow), OIDDest(OIDDest), OIDSrc(OIDSrc),
+        KillDest(KillDest) {}
+
+  OriginID getDestOriginID() const { return OIDDest; }
+  OriginID getSrcOriginID() const { return OIDSrc; }
+  bool getKillDest() const { return KillDest; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &OM) const override {
+    OS << "OriginFlow (Dest: ";
+    OM.dump(getDestOriginID(), OS);
+    OS << ", Src: ";
+    OM.dump(getSrcOriginID(), OS);
+    OS << (getKillDest() ? "" : ", Merge");
+    OS << ")\n";
+  }
+};
+
+class ReturnOfOriginFact : public Fact {
+  OriginID OID;
+
+public:
+  static bool classof(const Fact *F) {
+    return F->getKind() == Kind::ReturnOfOrigin;
+  }
+
+  ReturnOfOriginFact(OriginID OID) : Fact(Kind::ReturnOfOrigin), OID(OID) {}
+  OriginID getReturnedOriginID() const { return OID; }
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &OM) const override {
+    OS << "ReturnOfOrigin (";
+    OM.dump(getReturnedOriginID(), OS);
+    OS << ")\n";
+  }
+};
+
+class UseFact : public Fact {
+  const Expr *UseExpr;
+  // True if this use is a write operation (e.g., left-hand side of assignment).
+  // Write operations are exempted from use-after-free checks.
+  bool IsWritten = false;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::Use; }
+
+  UseFact(const Expr *UseExpr) : Fact(Kind::Use), UseExpr(UseExpr) {}
+
+  OriginID getUsedOrigin(const OriginManager &OM) const {
+    // TODO: Remove const cast and make OriginManager::get as const.
+    return const_cast<OriginManager &>(OM).get(*UseExpr);
+  }
+  const Expr *getUseExpr() const { return UseExpr; }
+  void markAsWritten() { IsWritten = true; }
+  bool isWritten() const { return IsWritten; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &OM) const override {
+    OS << "Use (";
+    OM.dump(getUsedOrigin(OM), OS);
+    OS << ", " << (isWritten() ? "Write" : "Read") << ")\n";
+  }
+};
+
+/// A dummy-fact used to mark a specific point in the code for testing.
+/// It is generated by recognizing a `void("__lifetime_test_point_...")` cast.
+class TestPointFact : public Fact {
+  StringRef Annotation;
+
+public:
+  static bool classof(const Fact *F) { return F->getKind() == Kind::TestPoint; }
+
+  explicit TestPointFact(StringRef Annotation)
+      : Fact(Kind::TestPoint), Annotation(Annotation) {}
+
+  StringRef getAnnotation() const { return Annotation; }
+
+  void dump(llvm::raw_ostream &OS, const LoanManager &,
+            const OriginManager &) const override {
+    OS << "TestPoint (Annotation: \"" << getAnnotation() << "\")\n";
+  }
+};
+
+class FactManager {
+public:
+  llvm::ArrayRef<const Fact *> getFacts(const CFGBlock *B) const {
+    auto It = BlockToFactsMap.find(B);
+    if (It != BlockToFactsMap.end())
+      return It->second;
+    return {};
+  }
+
+  void addBlockFacts(const CFGBlock *B, llvm::ArrayRef<Fact *> NewFacts) {
+    if (!NewFacts.empty())
+      BlockToFactsMap[B].assign(NewFacts.begin(), NewFacts.end());
+  }
+
+  template <typename FactType, typename... Args>
+  FactType *createFact(Args &&...args) {
+    void *Mem = FactAllocator.Allocate<FactType>();
+    return new (Mem) FactType(std::forward<Args>(args)...);
+  }
+
+  void dump(const CFG &Cfg, AnalysisDeclContext &AC) const {
+    llvm::dbgs() << "==========================================\n";
+    llvm::dbgs() << "       Lifetime Analysis Facts:\n";
+    llvm::dbgs() << "==========================================\n";
+    if (const Decl *D = AC.getDecl())
+      if (const auto *ND = dyn_cast<NamedDecl>(D))
+        llvm::dbgs() << "Function: " << ND->getQualifiedNameAsString() << "\n";
+    // Print blocks in the order as they appear in code for a stable ordering.
+    for (const CFGBlock *B : *AC.getAnalysis<PostOrderCFGView>()) {
+      llvm::dbgs() << "  Block B" << B->getBlockID() << ":\n";
+      auto It = BlockToFactsMap.find(B);
+      if (It != BlockToFactsMap.end()) {
+        for (const Fact *F : It->second) {
+          llvm::dbgs() << "    ";
+          F->dump(llvm::dbgs(), LoanMgr, OriginMgr);
+        }
+      }
+      llvm::dbgs() << "  End of Block\n";
+    }
+  }
+
+  LoanManager &getLoanMgr() { return LoanMgr; }
+  const LoanManager &getLoanMgr() const { return LoanMgr; }
+  OriginManager &getOriginMgr() { return OriginMgr; }
+  const OriginManager &getOriginMgr() const { return OriginMgr; }
+
+private:
+  LoanManager LoanMgr;
+  OriginManager OriginMgr;
+  llvm::DenseMap<const clang::CFGBlock *, llvm::SmallVector<const Fact *>>
+      BlockToFactsMap;
+  llvm::BumpPtrAllocator FactAllocator;
+};
+} // namespace internal
+} // namespace clang::lifetimes
+
+#endif // LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_FACTS_H
diff --git a/clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h b/clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
new file mode 100644
index 0000000000000..a904f3dc64a06
--- /dev/null
+++ b/clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
@@ -0,0 +1,108 @@
+//===- FactsGenerator.h - Lifetime Facts Generation -------------*- C++ -*-=...
[truncated]

@usx95 usx95 requested a review from Xazax-hun October 9, 2025 08:26
Copy link
Collaborator

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, some nits inline.

It might be hard to do but I wonder if we somehow could reduce the number of publicly exposed headers somehow at some point. That being said, this could be follow-up work.

@usx95 usx95 force-pushed the users/usx95/10-08-_lifetimesafety_refactor_the_analysis_into_smaller_files branch from 1131b15 to a351778 Compare October 9, 2025 12:55
@usx95 usx95 force-pushed the users/usx95/10-08-_lifetimesafety_refactor_the_analysis_into_smaller_files branch from 7c3cdda to c6e7bf0 Compare October 9, 2025 18:28
@usx95 usx95 requested review from jvoung and ymand October 9, 2025 18:28
Copy link
Collaborator

@ymand ymand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! I think it will really help maintenance and reviews.

// This file defines the LiveOriginAnalysis, a backward dataflow analysis that
// determines which origins are "live" at each program point. An origin is
// "live" at a program point if there's a potential future use of the pointer it
// represents. Liveness is "generated" by a read of origin's loan set (e.g., a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd replace "represents" with "is associated with". Also, in the sentence that follows you could describe in terms of the pointer, which I think would be a little clearer (e.g. "read of the pointer" instead of "read of the origin's loan set").

Copy link
Contributor Author

@usx95 usx95 Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. PTAL. Happy to address more comments post-commit.

@usx95 usx95 merged commit 2eb8c47 into main Oct 10, 2025
12 checks passed
@usx95 usx95 deleted the users/usx95/10-08-_lifetimesafety_refactor_the_analysis_into_smaller_files branch October 10, 2025 11:43
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-ubuntu-22-cmake-build-only running on rocm-docker-ubu-22 while building .github,clang,llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/203/builds/25839

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Looking for flock
-- Looking for flock - found
-- Linker detection: GNU ld
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS - Success
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for __x86_64__
-- Looking for __x86_64__ - found
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- Looking for logf128
-- Looking for logf128 - found
-- Targeting AMDGPU
-- Targeting SPIRV
-- Targeting X86
-- LLD version: 22.0.0
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test C_SUPPORTS_WUNDEF
-- Performing Test C_SUPPORTS_WUNDEF - Success
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY - Success
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6402/8118] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
[6403/8118] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[6404/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o
[6405/8118] Linking CXX shared library lib/libclangInstallAPI.so.22.0git
[6406/8118] Creating library symlink lib/libclangInstallAPI.so
[6407/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
[6408/8118] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/EntryPointStats.cpp.o
[6409/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o
[6410/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
[6411/8118] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-ubuntu-22-cmake-build-only/build/lib && :
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: in function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xbb): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xc6): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x10ad): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator15handleTestPointEPKNS_21CXXFunctionalCastExprE+0xd9): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0x70): undefined reference to `clang::Stmt::getEndLoc() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x9e): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xad): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x11e): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x294): undefined reference to `clang::CXXMethodDecl::isStatic() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2ae): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2c5): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2f8): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3a1): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3b3): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x64): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x79): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x99): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xc8): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x289): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x296): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xa7): undefined reference to `clang::VarDecl::getInit()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleAssignmentEPKNS_4ExprES5_+0x25): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr(clang::CXXOperatorCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator24VisitCXXOperatorCallExprEPKNS_19CXXOperatorCallExprE+0xb1): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitBinaryOperator(clang::BinaryOperator const*) [clone .part.0] [clone .isra.0]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator19VisitBinaryOperatorEPKNS_14BinaryOperatorE.part.0.isra.0+0x7e): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::run()':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x44): undefined reference to `clang::PostOrderCFGView::getTag()'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-8-cmake-build-only running on rocm-docker-rhel-8 while building .github,clang,llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/24651

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Failed
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Looking for flock
-- Looking for flock - found
-- Linker detection: GNU ld
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS - Success
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for __x86_64__
-- Looking for __x86_64__ - found
-- Found Git: /usr/bin/git (found version "2.43.5") 
-- Looking for logf128
-- Looking for logf128 - found
-- Targeting AMDGPU
-- Targeting SPIRV
-- Targeting X86
-- LLD version: 22.0.0
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test C_SUPPORTS_WUNDEF
-- Performing Test C_SUPPORTS_WUNDEF - Success
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY - Success
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES
Step 7 (build cmake config) failure: build cmake config (failure)
...
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/SmallVector.h:725:5:   required from ‘void llvm::SmallVectorImpl<T>::assign(ItTy, ItTy) [with ItTy = clang::lifetimes::internal::Fact* const*; <template-parameter-2-2> = void; T = const clang::lifetimes::internal::Fact*]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Analysis/Analyses/LifetimeSafety/Facts.h:196:65:   required from here
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/SmallVector.h:203:45: warning: parameter ‘From’ set but not used [-Wunused-but-set-parameter]
   void assertSafeToReferenceAfterClear(ItTy From, ItTy To) {
                                        ~~~~~^~~~
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/SmallVector.h:203:56: warning: parameter ‘To’ set but not used [-Wunused-but-set-parameter]
   void assertSafeToReferenceAfterClear(ItTy From, ItTy To) {
                                                   ~~~~~^~
cc1plus: warning: unrecognized command line option ‘-Wno-pass-failed’
[6377/8118] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-array-bounds -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/lib && :
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: In function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xb2): undefined reference to `clang::PostOrderCFGView::getTag()'
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xbd): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xe77): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) [clone .localalias.3]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator15handleTestPointEPKNS_21CXXFunctionalCastExprE+0xb9): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) [clone .localalias.6]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0x70): undefined reference to `clang::Stmt::getEndLoc() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xa2): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xb1): undefined reference to `clang::Decl::getAttrs() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x13e): undefined reference to `clang::Decl::getAttrs() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool) [clone .localalias.4]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x27b): undefined reference to `clang::CXXMethodDecl::isStatic() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x295): undefined reference to `clang::FunctionDecl::getNumParams() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2ac): undefined reference to `clang::FunctionDecl::getNumParams() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2df): undefined reference to `clang::Decl::getAttrs() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3b1): undefined reference to `clang::FunctionDecl::getNumParams() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3c3): undefined reference to `clang::FunctionDecl::getNumParams() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*) [clone .localalias.16]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x64): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*) [clone .localalias.17]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x69): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x8a): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x97): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xc4): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xf5): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*) [clone .localalias.20]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xaa): undefined reference to `clang::VarDecl::getInit()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) [clone .localalias.2]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleAssignmentEPKNS_4ExprES5_+0x21): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr(clang::CXXOperatorCallExpr const*) [clone .localalias.10]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator24VisitCXXOperatorCallExprEPKNS_19CXXOperatorCallExprE+0xa1): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::run()':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x33): undefined reference to `clang::PostOrderCFGView::getTag()'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x3e): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x313): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-9-cmake-build-only running on rocm-docker-rhel-9 while building .github,clang,llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/205/builds/24628

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Looking for flock
-- Looking for flock - found
-- Linker detection: GNU ld
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS - Success
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for __x86_64__
-- Looking for __x86_64__ - found
-- Found Git: /usr/bin/git (found version "2.43.5") 
-- Looking for logf128
-- Looking for logf128 - found
-- Targeting AMDGPU
-- Targeting SPIRV
-- Targeting X86
-- LLD version: 22.0.0
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test C_SUPPORTS_WUNDEF
-- Performing Test C_SUPPORTS_WUNDEF - Success
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY - Success
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6403/8118] Building AMDGPUGenGlobalISel.inc...
[6404/8118] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/EntryPointStats.cpp.o
[6405/8118] Linking CXX shared library lib/libclangInstallAPI.so.22.0git
[6406/8118] Creating library symlink lib/libclangInstallAPI.so
[6407/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
[6408/8118] Building AMDGPUGenDAGISel.inc...
[6409/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
[6410/8118] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/BlockCounter.cpp.o
[6411/8118] Building AMDGPUGenInstrInfo.inc...
[6412/8118] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/amdgpu-offload-rhel-9-cmake-build-only/build/lib && :
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: in function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xa0): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xab): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xfd1): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator15handleTestPointEPKNS_21CXXFunctionalCastExprE+0xc9): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0x70): undefined reference to `clang::Stmt::getEndLoc() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x9e): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xad): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x11e): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x292): undefined reference to `clang::CXXMethodDecl::isStatic() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2ac): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2c3): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2f6): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3a1): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3b3): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x64): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x61): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x81): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xb0): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x261): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x26e): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xa7): undefined reference to `clang::VarDecl::getInit()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleAssignmentEPKNS_4ExprES5_+0x21): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr(clang::CXXOperatorCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator24VisitCXXOperatorCallExprEPKNS_19CXXOperatorCallExprE+0xa9): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::run()':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x30): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x3b): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x30e): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building .github,clang,llvm at step 5 "compile-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/15195

Here is the relevant piece of the build log for the reference
Step 5 (compile-openmp) failure: build (failure)
...
10.065 [1085/64/3614] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/CheckerHelpers.cpp.o
10.135 [1084/64/3615] Building AMDGPUGenMCPseudoLowering.inc...
10.137 [1083/64/3616] Linking CXX shared library lib/libLLVMFuzzMutate.so.22.0git
10.146 [1082/64/3617] Creating library symlink lib/libLLVMFuzzMutate.so
10.229 [1081/64/3618] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/Environment.cpp.o
10.246 [1080/64/3619] Linking CXX shared library lib/libLLVMFrontendOpenMP.so.22.0git
10.256 [1079/64/3620] Creating library symlink lib/libLLVMFrontendOpenMP.so
10.402 [1078/64/3621] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/DynamicType.cpp.o
10.414 [1077/64/3622] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/AnalysisManager.cpp.o
10.474 [1076/64/3623] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib && :
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: in function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xbb): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xc6): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x10ad): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator15handleTestPointEPKNS_21CXXFunctionalCastExprE+0xd9): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0x70): undefined reference to `clang::Stmt::getEndLoc() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x9e): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xad): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x11e): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x294): undefined reference to `clang::CXXMethodDecl::isStatic() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2ae): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2c5): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2f8): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3a1): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3b3): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x64): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x79): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x99): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xc8): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x289): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x296): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xa7): undefined reference to `clang::VarDecl::getInit()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleAssignmentEPKNS_4ExprES5_+0x25): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr(clang::CXXOperatorCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator24VisitCXXOperatorCallExprEPKNS_19CXXOperatorCallExprE+0xb1): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitBinaryOperator(clang::BinaryOperator const*) [clone .part.0] [clone .isra.0]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator19VisitBinaryOperatorEPKNS_14BinaryOperatorE.part.0.isra.0+0x7e): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::run()':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x44): undefined reference to `clang::PostOrderCFGView::getTag()'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder hip-third-party-libs-test running on ext_buildbot_hw_05-hip-docker while building .github,clang,llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/206/builds/7348

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-tpl.py --jobs=32' (failure)
...
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG
-- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG - Success
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL
-- Performing Test CXX_WSUGGEST_OVERRIDE_ALLOWS_ONLY_FINAL - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test C_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG
-- Performing Test CXX_SUPPORTS_CTAD_MAYBE_UNSPPORTED_FLAG - Success
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test C_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG
-- Performing Test CXX_SUPPORTS_NO_PASS_FAILED_FLAG - Success
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Looking for flock
-- Looking for flock - found
-- Linker detection: GNU ld
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS
-- Performing Test LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS - Success
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for __x86_64__
-- Looking for __x86_64__ - found
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- Looking for logf128
-- Looking for logf128 - found
-- Targeting AMDGPU
-- Targeting SPIRV
-- Targeting X86
-- LLD version: 22.0.0
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Success
-- Performing Test C_SUPPORTS_WUNDEF
-- Performing Test C_SUPPORTS_WUNDEF - Success
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER
-- Performing Test CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER - Success
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY
-- Performing Test CXX_SUPPORTS_WNO_DEPRECTAED_COPY - Success
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES
Step 7 (build cmake config) failure: build cmake config (failure)
...
[6401/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o
[6402/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
[6403/8118] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
[6404/8118] Linking CXX shared library lib/libclangDriver.so.22.0git
[6405/8118] Creating library symlink lib/libclangDriver.so
[6406/8118] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/EntryPointStats.cpp.o
[6407/8118] Linking CXX shared library lib/libclangInstallAPI.so.22.0git
[6408/8118] Creating library symlink lib/libclangInstallAPI.so
[6409/8118] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
[6410/8118] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/botworker/bbot/hip-third-party-libs-test/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/botworker/bbot/hip-third-party-libs-test/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/botworker/bbot/hip-third-party-libs-test/build/lib && :
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: in function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xbb): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xc6): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x10ad): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator15handleTestPointEPKNS_21CXXFunctionalCastExprE+0xd9): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0x70): undefined reference to `clang::Stmt::getEndLoc() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x9e): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xad): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x11e): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x294): undefined reference to `clang::CXXMethodDecl::isStatic() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2ae): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2c5): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x2f8): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3a1): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x3b3): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x64): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x79): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x99): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xc8): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x289): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x296): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xa7): undefined reference to `clang::VarDecl::getInit()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleAssignmentEPKNS_4ExprES5_+0x25): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr(clang::CXXOperatorCallExpr const*) [clone .localalias]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator24VisitCXXOperatorCallExprEPKNS_19CXXOperatorCallExprE+0xb1): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitBinaryOperator(clang::BinaryOperator const*) [clone .part.0] [clone .isra.0]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator19VisitBinaryOperatorEPKNS_14BinaryOperatorE.part.0.isra.0+0x7e): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::run()':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x44): undefined reference to `clang::PostOrderCFGView::getTag()'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder clang-ppc64le-rhel running on ppc64le-clang-rhel-test while building .github,clang,llvm at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/145/builds/10175

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
66.882 [3062/192/3438] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMFrameLowering.cpp.o
66.896 [3061/192/3439] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMHazardRecognizer.cpp.o
66.923 [3060/192/3440] Linking CXX shared library lib/libLLVMFrontendOpenMP.so.22.0git
66.948 [3059/192/3441] Creating library symlink lib/libLLVMFrontendOpenMP.so
66.988 [3058/192/3442] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/ExprEngineObjC.cpp.o
67.112 [3057/192/3443] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMInstructionSelector.cpp.o
67.166 [3056/192/3444] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMISelDAGToDAG.cpp.o
67.174 [3055/192/3445] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMInstrInfo.cpp.o
67.182 [3054/192/3446] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/CheckExprLifetime.cpp.o
67.203 [3053/192/3447] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: [code=1] lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /home/buildbots/llvm-external-buildbots/clang.20.1.8/bin/clang++ --gcc-toolchain=/gcc-toolchain/usr -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -Wl,--color-diagnostics  -Wl,--gc-sections  -Xlinker --dependency-file=tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/clangAnalysisLifetimeSafety.dir/link.d -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib && :
ld.lld: error: undefined symbol: clang::PostOrderCFGView::getTag()
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::AnalysisDeclContext::getAnalysisImpl(void const*)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::NamedDecl::getQualifiedNameAsString[abi:cxx11]() const
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)

ld.lld: error: undefined symbol: clang::Stmt::getEndLoc() const
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&))


@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building .github,clang,llvm at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/16614

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
71.754 [1072/19/6828] Linking CXX shared library lib/libMLIRControlFlowDialect.so.22.0git
71.758 [1071/19/6829] Creating library symlink lib/libMLIRDialectUtils.so
71.769 [1066/23/6830] Creating library symlink lib/libMLIRCAPIArith.so
71.773 [1066/22/6831] Creating library symlink lib/libMLIRControlFlowDialect.so
71.783 [1063/24/6832] Linking CXX shared library lib/libMLIRArithAttrToLLVMConversion.so.22.0git
71.799 [1062/24/6833] Linking CXX shared library lib/libMLIRTransformUtils.so.22.0git
71.802 [1061/24/6834] Creating library symlink lib/libMLIRArithAttrToLLVMConversion.so
71.815 [1061/23/6835] Creating library symlink lib/libMLIRTransformUtils.so
71.828 [1057/26/6836] Linking CXX shared library lib/libMLIRComplexDialect.so.22.0git
71.832 [1056/26/6837] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib && :
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: in function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x54): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x60): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x8d0): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o: in function `clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const':
Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x1a4): undefined reference to `clang::NamedDecl::getQualifiedNameAsString[abi:cxx11]() const'
/usr/bin/ld: Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x1f4): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x200): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x228): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::run()':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x44): undefined reference to `clang::PostOrderCFGView::getTag()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x50): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x7c): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator3runEv+0x1d4): undefined reference to `clang::Stmt::getEndLoc() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0x88): undefined reference to `clang::Stmt::getEndLoc() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xd8): undefined reference to `clang::VarDecl::getInit()'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x30): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x40): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x8c): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x4c): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x68): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x74): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xa0): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xc8): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0xe8): undefined reference to `clang::CXXMethodDecl::isStatic() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0xf4): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x104): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x128): undefined reference to `clang::Decl::getAttrs() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x168): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x178): undefined reference to `clang::FunctionDecl::getNumParams() const'
/usr/bin/ld: tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: in function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x34): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder bolt-aarch64-ubuntu-shared running on bolt-worker-aarch64 while building .github,clang,llvm at step 6 "test-build-bolt-check-bolt".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/218/builds/157

Here is the relevant piece of the build log for the reference
Step 6 (test-build-bolt-check-bolt) failure: test (failure)
...
13.374 [227/34/1427] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Frontend.cpp.o
13.411 [226/34/1428] Building CXX object tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/FunctionSummary.cpp.o
13.420 [225/34/1429] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Visitor.cpp.o
13.441 [224/34/1430] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/CompilerInvocation.cpp.o
13.517 [223/34/1431] Linking CXX shared library lib/libclangInstallAPI.so.22.0git
13.528 [222/34/1432] Creating library symlink lib/libclangInstallAPI.so
13.852 [221/34/1433] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
13.872 [220/34/1434] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o
14.020 [219/34/1435] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
14.075 [218/34/1436] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-dangling-reference -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbot/workspace/bolt-aarch64-ubuntu-shared/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/buildbot/workspace/bolt-aarch64-ubuntu-shared/build/lib && :
ld.lld: error: undefined symbol: clang::AnalysisDeclContext::getCFG()
>>> referenced by LifetimeSafety.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o:(clang::lifetimes::internal::LifetimeSafetyAnalysis::run() (.localalias))

ld.lld: error: undefined symbol: clang::Decl::getASTContext() const
>>> referenced by LifetimeSafety.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o:(clang::lifetimes::internal::LifetimeSafetyAnalysis::run() (.localalias))
>>> referenced by LifetimeAnnotations.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o:(clang::lifetimes::isNormalAssignmentOperator(clang::FunctionDecl const*) (.localalias))

ld.lld: error: undefined symbol: clang::CFG::dump(clang::LangOptions const&, bool) const
>>> referenced by LifetimeSafety.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o:(clang::lifetimes::internal::LifetimeSafetyAnalysis::run() (.localalias))

ld.lld: error: undefined symbol: clang::NamedDecl::isCXXInstanceMember() const
>>> referenced by LifetimeAnnotations.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o:(clang::lifetimes::isNormalAssignmentOperator(clang::FunctionDecl const*) (.localalias))

ld.lld: error: undefined symbol: clang::DeclarationName::getAsString[abi:cxx11]() const
>>> referenced by Loans.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o:(clang::lifetimes::internal::Loan::dump(llvm::raw_ostream&) const)
>>> referenced by Origins.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o:(clang::lifetimes::internal::OriginManager::dump(clang::lifetimes::internal::utils::ID<clang::lifetimes::internal::OriginTag>, llvm::raw_ostream&) const)

ld.lld: error: undefined symbol: clang::FunctionDecl::getNumParams() const
>>> referenced by LifetimeAnnotations.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o:(clang::lifetimes::isNormalAssignmentOperator(clang::FunctionDecl const*) (.localalias))
>>> referenced by LifetimeAnnotations.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o:(clang::lifetimes::isAssignmentOperatorLifetimeBound(clang::CXXMethodDecl const*))
>>> referenced by LifetimeAnnotations.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o:(clang::lifetimes::isAssignmentOperatorLifetimeBound(clang::CXXMethodDecl const*))
>>> referenced 4 more times

ld.lld: error: undefined symbol: clang::Type::getUnqualifiedDesugaredType() const
>>> referenced by LifetimeAnnotations.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o:(clang::lifetimes::isNormalAssignmentOperator(clang::FunctionDecl const*) (.localalias))
>>> referenced by LifetimeAnnotations.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder bolt-x86_64-ubuntu-shared running on bolt-worker while building .github,clang,llvm at step 6 "test-build-bolt-check-bolt".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/151/builds/6948

Here is the relevant piece of the build log for the reference
Step 6 (test-build-bolt-check-bolt) failure: test (failure)
...
15.109 [264/18/1406] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
15.113 [263/18/1407] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o
15.120 [262/18/1408] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/FileList.cpp.o
15.129 [261/18/1409] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/DylibVerifier.cpp.o
15.141 [260/18/1410] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/HeaderFile.cpp.o
15.148 [259/18/1411] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/Library.cpp.o
15.174 [258/18/1412] Building CXX object tools/clang/lib/InstallAPI/CMakeFiles/obj.clangInstallAPI.dir/DiagnosticBuilderWrappers.cpp.o
15.183 [257/18/1413] Building CXX object tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/InterfaceStubFunctionsConsumer.cpp.o
15.340 [256/18/1414] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
15.435 [255/18/1415] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/worker/bolt-worker2/bolt-x86_64-ubuntu-shared/build/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/worker/bolt-worker2/bolt-x86_64-ubuntu-shared/build/lib && :
ld.lld: error: undefined symbol: clang::Expr::IgnoreParenImpCasts()
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) (.localalias))
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) (.localalias))
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::VisitBinaryOperator(clang::BinaryOperator const*) (.part.0.isra.0))

ld.lld: error: undefined symbol: clang::NamedDecl::getQualifiedNameAsString[abi:cxx11]() const
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)

ld.lld: error: undefined symbol: clang::Stmt::getEndLoc() const
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) (.localalias))

ld.lld: error: undefined symbol: clang::PostOrderCFGView::getTag()
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by LoanPropagation.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o:(clang::lifetimes::internal::DataflowAnalysis<clang::lifetimes::internal::(anonymous namespace)::AnalysisImpl, clang::lifetimes::internal::(anonymous namespace)::Lattice, (clang::lifetimes::internal::Direction)0>::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::AnalysisDeclContext::getAnalysisImpl(void const*)
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by LoanPropagation.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o:(clang::lifetimes::internal::DataflowAnalysis<clang::lifetimes::internal::(anonymous namespace)::AnalysisImpl, clang::lifetimes::internal::(anonymous namespace)::Lattice, (clang::lifetimes::internal::Direction)0>::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder polly-x86_64-linux-shared-plugin running on polly-x86_64-gce2 while building .github,clang,llvm at step 5 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/118/builds/8455

Here is the relevant piece of the build log for the reference
Step 5 (build) failure: 'ninja' (failure)
...
[3331/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
[3332/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
[3333/4536] Building CXX object tools/clang/lib/Edit/CMakeFiles/obj.clangEdit.dir/EditedSource.cpp.o
[3334/4536] Building CXX object tools/clang/lib/Edit/CMakeFiles/obj.clangEdit.dir/Commit.cpp.o
[3335/4536] Building CXX object tools/clang/lib/Edit/CMakeFiles/obj.clangEdit.dir/RewriteObjCFoundationAPI.cpp.o
[3336/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o
[3337/4536] Linking CXX shared library lib/libclangEdit.so.22.0git
[3338/4536] Creating library symlink lib/libclangEdit.so
[3339/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o
[3340/4536] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/worker/buildbot-workers/polly-x86_64-gce2/rundir/llvm.obj/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/worker/buildbot-workers/polly-x86_64-gce2/rundir/llvm.obj/lib && :
ld.lld: error: undefined symbol: clang::PostOrderCFGView::getTag()
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::AnalysisDeclContext::getAnalysisImpl(void const*)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::NamedDecl::getQualifiedNameAsString[abi:cxx11]() const
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)

ld.lld: error: undefined symbol: clang::Expr::IgnoreParenImpCasts()
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) (.localalias))
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) (.localalias))
>>> referenced by FactsGenerator.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder polly-x86_64-linux-shared running on polly-x86_64-gce2 while building .github,clang,llvm at step 5 "build".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/97/builds/8798

Here is the relevant piece of the build log for the reference
Step 5 (build) failure: 'ninja' (failure)
...
[3307/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o
[3308/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o
[3309/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o
[3310/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o
[3311/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o
[3312/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o
[3313/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o
[3314/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o
[3315/4536] Building CXX object tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o
[3316/4536] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/worker/buildbot-workers/polly-x86_64-gce2/rundir/llvm.obj/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/worker/buildbot-workers/polly-x86_64-gce2/rundir/llvm.obj/lib && :
ld.lld: error: undefined symbol: clang::PostOrderCFGView::getTag()
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::AnalysisDeclContext::getAnalysisImpl(void const*)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)
>>> referenced by Checker.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o:(clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*))
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::run())
>>> referenced 2 more times

ld.lld: error: undefined symbol: clang::NamedDecl::getQualifiedNameAsString[abi:cxx11]() const
>>> referenced by Facts.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o:(clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const)

ld.lld: error: undefined symbol: clang::Expr::IgnoreParenImpCasts()
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) (.localalias))
>>> referenced by FactsGenerator.cpp
>>>               tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o:(clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) (.localalias))
>>> referenced by FactsGenerator.cpp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-multistage running on ppc64le-clang-multistage-test while building .github,clang,llvm at step 4 "build stage 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/76/builds/13137

Here is the relevant piece of the build log for the reference
Step 4 (build stage 1) failure: 'ninja' (failure)
...
[5547/6553] Building CXX object tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/NSErrorChecker.cpp.o
[5548/6553] Creating library symlink lib/libLLVMAArch64Disassembler.so
[5549/6553] Linking CXX shared library lib/libLLVMAArch64AsmParser.so.22.0git
[5550/6553] Creating library symlink lib/libLLVMAArch64AsmParser.so
[5551/6553] Linking CXX shared library lib/libLLVMFuzzMutate.so.22.0git
[5552/6553] Creating library symlink lib/libLLVMFuzzMutate.so
[5553/6553] Building AMDGPUGenMCPseudoLowering.inc...
[5554/6553] Linking CXX shared library lib/libLLVMFrontendOpenMP.so.22.0git
[5555/6553] Creating library symlink lib/libLLVMFrontendOpenMP.so
[5556/6553] Linking CXX shared library lib/libclangAnalysisLifetimeSafety.so.22.0git
FAILED: lib/libclangAnalysisLifetimeSafety.so.22.0git 
: && /usr/lib64/ccache/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-array-bounds -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -Wno-pass-failed -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/./lib  -Wl,--gc-sections -shared -Wl,-soname,libclangAnalysisLifetimeSafety.so.22.0git -o lib/libclangAnalysisLifetimeSafety.so.22.0git tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeAnnotations.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LifetimeSafety.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LiveOrigins.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Loans.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/LoanPropagation.cpp.o tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Origins.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib:"  lib/libLLVMFrontendOpenMP.so.22.0git  lib/libLLVMSupport.so.22.0git  -Wl,-rpath-link,/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/lib && :
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Checker.cpp.o: In function `clang::lifetimes::internal::runLifetimeChecker(clang::lifetimes::internal::LoanPropagationAnalysis const&, clang::lifetimes::internal::LiveOriginsAnalysis const&, clang::lifetimes::internal::FactManager const&, clang::AnalysisDeclContext&, clang::lifetimes::LifetimeSafetyReporter*)':
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xa0): undefined reference to `clang::PostOrderCFGView::getTag()'
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0xb0): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
Checker.cpp:(.text._ZN5clang9lifetimes8internal18runLifetimeCheckerERKNS1_23LoanPropagationAnalysisERKNS1_19LiveOriginsAnalysisERKNS1_11FactManagerERNS_19AnalysisDeclContextEPNS0_22LifetimeSafetyReporterE+0x1000): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/Facts.cpp.o: In function `clang::lifetimes::internal::FactManager::dump(clang::CFG const&, clang::AnalysisDeclContext&) const':
Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x12c): undefined reference to `clang::NamedDecl::getQualifiedNameAsString[abi:cxx11]() const'
Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x190): undefined reference to `clang::PostOrderCFGView::getTag()'
Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x1a0): undefined reference to `clang::AnalysisDeclContext::getAnalysisImpl(void const*)'
Facts.cpp:(.text._ZNK5clang9lifetimes8internal11FactManager4dumpERKNS_3CFGERNS_19AnalysisDeclContextE+0x638): undefined reference to `clang::PostOrderCFGView::create(clang::AnalysisDeclContext&)'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleTestPoint(clang::CXXFunctionalCastExpr const*) [clone .localalias.3]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator15handleTestPointEPKNS_21CXXFunctionalCastExprE+0xa4): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleDestructor(clang::CFGAutomaticObjDtor const&) [clone .localalias.6]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleDestructorERKNS_19CFGAutomaticObjDtorE+0xa4): undefined reference to `clang::Stmt::getEndLoc() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::isGslPointerType(clang::QualType)':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0xc0): undefined reference to `clang::ClassTemplateSpecializationDecl::getSpecializedTemplate() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x160): undefined reference to `clang::Decl::getAttrs() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internalL16isGslPointerTypeENS_8QualTypeE+0x200): undefined reference to `clang::Decl::getAttrs() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleFunctionCall(clang::Expr const*, clang::FunctionDecl const*, llvm::ArrayRef<clang::Expr const*>, bool) [clone .localalias.4]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x328): undefined reference to `clang::CXXMethodDecl::isStatic() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x33c): undefined reference to `clang::FunctionDecl::getNumParams() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x350): undefined reference to `clang::FunctionDecl::getNumParams() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x380): undefined reference to `clang::Decl::getAttrs() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x48c): undefined reference to `clang::FunctionDecl::getNumParams() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator18handleFunctionCallEPKNS_4ExprEPKNS_12FunctionDeclEN4llvm8ArrayRefIS5_EEb+0x4ac): undefined reference to `clang::FunctionDecl::getNumParams() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitCallExpr(clang::CallExpr const*) [clone .localalias.16]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitCallExprEPKNS_8CallExprE+0x44): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr(clang::CXXMemberCallExpr const*) [clone .localalias.17]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x98): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0xd0): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x230): undefined reference to `clang::Expr::getReferencedDeclOfCallee()'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x25c): undefined reference to `clang::CXXMemberCallExpr::getMethodDecl() const'
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator22VisitCXXMemberCallExprEPKNS_17CXXMemberCallExprE+0x26c): undefined reference to `clang::CXXMemberCallExpr::getImplicitObjectArgument() const'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitDeclStmt(clang::DeclStmt const*) [clone .localalias.20]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator13VisitDeclStmtEPKNS_8DeclStmtE+0xdc): undefined reference to `clang::VarDecl::getInit()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::handleAssignment(clang::Expr const*, clang::Expr const*) [clone .localalias.2]':
FactsGenerator.cpp:(.text._ZN5clang9lifetimes8internal14FactsGenerator16handleAssignmentEPKNS_4ExprES5_+0x38): undefined reference to `clang::Expr::IgnoreParenImpCasts()'
tools/clang/lib/Analysis/LifetimeSafety/CMakeFiles/obj.clangAnalysisLifetimeSafety.dir/FactsGenerator.cpp.o: In function `clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr(clang::CXXOperatorCallExpr const*) [clone .localalias.10]':

@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 10, 2025

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-test-suite running on ppc64le-clang-test-suite while building .github,clang,llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/18686

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'SanitizerCommon-ubsan-powerpc64le-Linux :: Linux/getpwnam_r_invalid_user.cpp' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=undefined  -m64 -fno-function-sections -funwind-tables  -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test -ldl -O0 -g /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp &&  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp # RUN: at line 2
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=undefined -m64 -fno-function-sections -funwind-tables -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test -ldl -O0 -g /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
+ /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
Result: 110
getpwnam_r_invalid_user.cpp.tmp: /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp:19: int main(): Assertion `res == 0 || res == ENOENT' failed.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.script: line 1: 878865 Aborted                 (core dumped) /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/ubsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp

--

********************


@shiltian
Copy link
Contributor

shiltian commented Oct 10, 2025

The clang library clangAnalysisLifetimeSafety doesn't set any dependencies so it completely breaks dynamic library build. I've gone ahead and reverted it.

shiltian added a commit that referenced this pull request Oct 10, 2025
…2474)"

This reverts commit 2eb8c47 since it completely breaks dylib build.
@usx95
Copy link
Contributor Author

usx95 commented Oct 10, 2025

Thanks for the revert and sorry for the noise. Will fix forward.

usx95 added a commit that referenced this pull request Oct 11, 2025
…62474)"

This reverts commit 24a5d8a.

Add link libs to the new clang library
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
Restructure the C++ Lifetime Safety Analysis into modular components
with clear separation of concerns.

This PR reorganizes the C++ Lifetime Safety Analysis code by:

1. Breaking up the monolithic `LifetimeSafety.cpp` (1500+ lines) into
multiple smaller, focused files
2. Creating a dedicated `LifetimeSafety` directory with a clean
component structure
3. Introducing header files for each component with proper documentation
4. Moving existing code into the appropriate component files:
    - `Checker.h/cpp`: Core lifetime checking logic
    - `Dataflow.h`: Generic dataflow analysis framework
    - `Facts.h`: Lifetime-relevant events and fact management
    - `FactsGenerator.h/cpp`: AST traversal for fact generation
- `LiveOrigins.h/cpp`: Backward dataflow analysis for origin liveness
- `LoanPropagation.h/cpp`: Forward dataflow analysis for loan tracking
    - `Loans.h`: Loan and access path definitions
    - `Origins.h`: Origin management
    - `Reporter.h`: Interface for reporting lifetime violations
    - `Utils.h`: Common utilities for the analysis

The code functionality remains the same, but is now better organized
with clearer interfaces between components.
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
…m#162474)"

This reverts commit 2eb8c47 since it completely breaks dylib build.
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
…vm#162474)"

This reverts commit 24a5d8a.

Add link libs to the new clang library
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:analysis clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:temporal-safety Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr) clang Clang issues not falling into any other category

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants