clang 23.0.0git
clang::ssaf::LUSummaryConsumer Class Referencefinal

Consumes a LUSummary by dispatching its entity data to registered SummaryDataBuilders and returning the results in a SummaryDataStore. More...

#include "clang/ScalableStaticAnalysisFramework/Core/SummaryData/LUSummaryConsumer.h"

Public Member Functions

 LUSummaryConsumer (std::unique_ptr< LUSummary > LU)
SummaryDataStore run () &&
 Processes all registered analyses in LUSummary and returns the results.
llvm::Expected< SummaryDataStorerun (llvm::ArrayRef< SummaryName > Names)
 Processes the named analyses and returns the results.
template<typename... DataTs>
llvm::Expected< SummaryDataStorerun ()
 Processes analyses for each of the given types and returns the results.

Detailed Description

Consumes a LUSummary by dispatching its entity data to registered SummaryDataBuilders and returning the results in a SummaryDataStore.

Three consumption patterns are supported:

  • run() && — processes every analysis present in the LUSummary, silently skipping any whose data is absent or whose builder is not registered. Cannot fail, so it returns SummaryDataStore directly. Requires an rvalue consumer because this pattern exhausts all remaining data.
  • run(names) — processes a named subset; returns llvm::Expected<SummaryDataStore> and fails if any requested name has no data in the LUSummary or no registered builder.
  • run<DataTs...>() — type-safe variant of run(names) with the same error semantics and return type.

All patterns consume the underlying LUSummary data, so each analysis can only be retrieved once across all run() calls.

Definition at line 46 of file LUSummaryConsumer.h.

Constructor & Destructor Documentation

◆ LUSummaryConsumer()

clang::ssaf::LUSummaryConsumer::LUSummaryConsumer ( std::unique_ptr< LUSummary > LU)
inlineexplicit

Definition at line 48 of file LUSummaryConsumer.h.

Member Function Documentation

◆ run() [1/3]

template<typename... DataTs>
llvm::Expected< SummaryDataStore > clang::ssaf::LUSummaryConsumer::run ( )
inlinenodiscard

Processes analyses for each of the given types and returns the results.

Returns an error if any type has no data in the LUSummary or no registered builder.

Definition at line 70 of file LUSummaryConsumer.h.

References run().

Referenced by run().

◆ run() [2/3]

SummaryDataStore LUSummaryConsumer::run ( ) &&
nodiscard

Processes all registered analyses in LUSummary and returns the results.

Silently skips analyses with no data or no registered builder.

Requires an rvalue consumer (call as std::move(Consumer).run()) because this pattern exhausts all remaining LUSummary data.

Definition at line 61 of file LUSummaryConsumer.cpp.

References clang::Result.

◆ run() [3/3]

llvm::Expected< SummaryDataStore > LUSummaryConsumer::run ( llvm::ArrayRef< SummaryName > Names)
nodiscard

Processes the named analyses and returns the results.

Returns an error if any name has no data in the LUSummary or no registered builder.

Definition at line 49 of file LUSummaryConsumer.cpp.

References clang::Result.


The documentation for this class was generated from the following files: