clang 24.0.0git
clang::ssaf::EntityLinker Class Reference

#include "clang/ScalableStaticAnalysis/Core/EntityLinker/EntityLinker.h"

Public Member Functions

 EntityLinker (llvm::Triple TargetTriple, NestedBuildNamespace LUNamespace)
 Constructs an EntityLinker to link TU summaries into a LU summary.
llvm::Error link (std::unique_ptr< TUSummaryEncoding > Summary)
 Links a TU summary into a LU summary.
llvm::Error link (std::unique_ptr< StaticLibrary > Library)
 Links every member of a static library into the LU summary.
llvm::Error link (std::unique_ptr< MultiArchStaticLibrary > Library)
 Links the architecture member matching this link unit into the LU summary.
size_t getLinkedTUCount () const
 Returns the number of TU summaries folded in so far.
LUSummaryEncoding takeOutput () &&
 Returns the accumulated LU summary.

Detailed Description

Definition at line 34 of file EntityLinker.h.

Constructor & Destructor Documentation

◆ EntityLinker()

clang::ssaf::EntityLinker::EntityLinker ( llvm::Triple TargetTriple,
NestedBuildNamespace LUNamespace )
inline

Constructs an EntityLinker to link TU summaries into a LU summary.

Parameters
TargetTripleThe target triple of the link unit. Every linked input must report the same triple.
LUNamespaceThe namespace identifying this link unit.

Definition at line 47 of file EntityLinker.h.

Member Function Documentation

◆ getLinkedTUCount()

size_t clang::ssaf::EntityLinker::getLinkedTUCount ( ) const
inline

Returns the number of TU summaries folded in so far.

Counts members expanded from libraries as well as TU summaries linked directly, so it is not the number of link() calls.

Definition at line 88 of file EntityLinker.h.

◆ link() [1/3]

llvm::Error EntityLinker::link ( std::unique_ptr< MultiArchStaticLibrary > Library)

Links the architecture member matching this link unit into the LU summary.

Members for other architectures are discarded.

Parameters
LibraryThe multi-arch static library to link. Ownership is transferred.
Returns
Error if Library has no member whose target triple equals this link unit's, or if the selected member fails to link; success otherwise.

Definition at line 252 of file EntityLinker.cpp.

References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), clang::Library, link(), clang::Member, and ErrorMessages::NoMemberForTargetTriple.

◆ link() [2/3]

llvm::Error EntityLinker::link ( std::unique_ptr< StaticLibrary > Library)

Links every member of a static library into the LU summary.

Members are folded in unconditionally, in an unspecified order, exactly as if each had been passed as an individual TU summary.

Parameters
LibraryThe static library to link. Ownership is transferred.
Returns
Error if Library reports a different target triple than this link unit or if any member fails to link, success otherwise.

Definition at line 231 of file EntityLinker.cpp.

References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::context(), clang::Library, link(), ErrorMessages::LinkingStaticLibraryMember, and clang::ssaf::ErrorBuilder::wrap().

◆ link() [3/3]

llvm::Error EntityLinker::link ( std::unique_ptr< TUSummaryEncoding > Summary)

Links a TU summary into a LU summary.

Deduplicates entities, patches entity ID references in the entity summary, and merges them into a single data store.

Parameters
SummaryThe TU summary to link. Ownership is transferred.
Returns
Error if Summary reports a different target triple than this link unit, if its TU namespace has already been linked, or if patching fails; success otherwise. Corrupted summary data (missing linkage information, duplicate entity IDs, etc.) triggers a fatal error.

Definition at line 210 of file EntityLinker.cpp.

References clang::ssaf::ErrorBuilder::build(), clang::ssaf::ErrorBuilder::create(), and ErrorMessages::DuplicateTUNamespace.

Referenced by link(), and link().

◆ takeOutput()

LUSummaryEncoding clang::ssaf::EntityLinker::takeOutput ( ) &&
inline

Returns the accumulated LU summary.

Returns
LU summary containing all the deduplicated and patched entity summaries.

Definition at line 94 of file EntityLinker.h.


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