sun::abi::AbiCompatibilityChecker

sun::abi::AbiCompatibilityChecker

class · Source (opens in a new tab)

class sun::abi::AbiCompatibilityChecker

Validates imports and owns compilation-scoped caches, warnings, and requirements.

Public Functions

AbiCompatibilityChecker

AbiCompatibilityChecker(std::string targetTriple="", NativeExecution execution=NativeExecution::JIT)

public · function · Source (opens in a new tab)

sun::abi::AbiCompatibilityChecker::AbiCompatibilityChecker(std::string targetTriple="", NativeExecution execution=NativeExecution::JIT)

Creates an isolated checker for the host or an explicitly selected target.

Related: NativeExecution, NativeExecution::JIT

AbiCompatibilityChecker(CompilationContext context)

public · function · Source (opens in a new tab)

sun::abi::AbiCompatibilityChecker::AbiCompatibilityChecker(CompilationContext context)

Creates a checker with the complete compilation settings.

Related: CompilationContext

acceptsNominalBorrow

public · function · Source (opens in a new tab)

bool sun::abi::AbiCompatibilityChecker::acceptsNominalBorrow(const sun::semantic_analysis::QualifiedName &source, const sun::semantic_analysis::QualifiedName &target, NominalKind kind) const

Checks a borrowed nominal argument without replacing either declaration.

Related: sun::semantic_analysis::QualifiedName, NominalKind

beginCompilation

public · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::beginCompilation(const std::string &targetTriple, NativeExecution execution=NativeExecution::JIT)

Starts a compilation, discarding cached authorizations and warning state.

Related: NativeExecution, NativeExecution::JIT

bytesHash

public · function · Source (opens in a new tab)

std::string sun::abi::AbiCompatibilityChecker::bytesHash(const moon_bundling::MoonReader &reader) const

Hashes the immutable bundle snapshot for build and validation cache keys.

Related: moon_bundling::MoonReader

configure

public · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::configure(CompilationContext context)

Resets authorizations when any compilation setting changes.

Related: CompilationContext

context

public · function · Source (opens in a new tab)

const CompilationContext & sun::abi::AbiCompatibilityChecker::context() const

Returns immutable settings used by all validations in this checker.

Related: CompilationContext

current

public · function · static · Source (opens in a new tab)

AbiCompatibilityChecker & sun::abi::AbiCompatibilityChecker::current()

Returns the current thread's checker shared by compiler import paths.

Related: AbiCompatibilityChecker

hasValidationScope

public · function · static · Source (opens in a new tab)

bool sun::abi::AbiCompatibilityChecker::hasValidationScope()

Reports whether an explicit compilation scope owns the current checker.

importedContracts

public · function · Source (opens in a new tab)

const std::map< std::string, BundleContract > & sun::abi::AbiCompatibilityChecker::importedContracts() const

Returns requirements inherited from imports accepted during this compilation.

Related: BundleContract

prepareCompilation

public · function · static · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::prepareCompilation(const std::string &targetTriple, NativeExecution execution, bool debugInfo, bool optimize, unsigned exceptionTraceDepth=sun::abi::exceptions::defaultTraceDepth)

Prepares a driver, retaining matching preflight state inside a scope.

Related: NativeExecution, sun::abi::exceptions::defaultTraceDepth

validate

validate(moon_bundling::MoonReader &reader)

public · function · Source (opens in a new tab)

ValidatedBundle sun::abi::AbiCompatibilityChecker::validate(moon_bundling::MoonReader &reader)

Checks the complete contract and all payloads against this compilation.

Related: ValidatedBundle, moon_bundling::MoonReader

validate(moon_bundling::MoonReader &reader, const std::string &targetTriple)

public · function · Source (opens in a new tab)

ValidatedBundle sun::abi::AbiCompatibilityChecker::validate(moon_bundling::MoonReader &reader, const std::string &targetTriple)

Checks an explicitly selected target without changing the compilation target.

Related: ValidatedBundle, moon_bundling::MoonReader

validateContract

public · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::validateContract(const BundleContract &contract, const std::string &bundle, const std::string &targetTriple) const

Checks contract requirements only; this does not authorize a compiled payload.

Related: BundleContract

validateImports

public · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::validateImports(const std::vector< moon_bundling::MoonReader * > &readers, const std::string &entrypoint="")

Checks a complete import set, including external references, before use.

Related: moon_bundling::MoonReader

Private Functions

collectCompatibleRevisions

private · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::collectCompatibleRevisions(const std::vector< moon_bundling::MoonReader * > &readers)

Records ABI-compatible artifact pairs for later argument checks.

Related: moon_bundling::MoonReader

recordValidatedImport

private · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::recordValidatedImport(const BundleContract &contract, const std::string &bytesHash, const std::string &bundle)

Retains requirements and emits at most one producer warning per exact bundle.

Related: BundleContract

validateImpl

private · function · Source (opens in a new tab)

ValidatedBundle sun::abi::AbiCompatibilityChecker::validateImpl(moon_bundling::MoonReader &reader, const std::string &targetTriple, bool record)

Validates immutable bytes, optionally recording an authorized import.

Related: ValidatedBundle, moon_bundling::MoonReader

validatePayload

private · function · Source (opens in a new tab)

void sun::abi::AbiCompatibilityChecker::validatePayload(const BundleContract &contract, const llvm::Module &module, const std::string &bundle, const std::string &targetTriple) const

Checks emitted boundaries against the independently supported contract.

Related: BundleContract

Private Fields

byteHashes_

private · variable · Source (opens in a new tab)

std::map<std::weak_ptr<const std::string>, std::string, std::owner_less<std::weak_ptr<const std::string> > > sun::abi::AbiCompatibilityChecker::byteHashes_

No documentation comment.

compatibleRevisions_

private · variable · Source (opens in a new tab)

std::set<std::pair<std::string, std::string> > sun::abi::AbiCompatibilityChecker::compatibleRevisions_

No documentation comment.

context_

private · variable · Source (opens in a new tab)

CompilationContext sun::abi::AbiCompatibilityChecker::context_

No documentation comment.

Related: CompilationContext

importedContracts_

private · variable · Source (opens in a new tab)

std::map<std::string, BundleContract> sun::abi::AbiCompatibilityChecker::importedContracts_

No documentation comment.

Related: BundleContract

revisions_

private · variable · Source (opens in a new tab)

std::map<std::string, proto::LibraryAbiSnapshot> sun::abi::AbiCompatibilityChecker::revisions_

No documentation comment.

validatedBundles_

private · variable · Source (opens in a new tab)

std::map<std::pair<std::string, std::string>, std::shared_ptr<const BundleContract> > sun::abi::AbiCompatibilityChecker::validatedBundles_

No documentation comment.

Related: BundleContract

warnedBundles_

private · variable · Source (opens in a new tab)

std::set<std::string> sun::abi::AbiCompatibilityChecker::warnedBundles_

No documentation comment.