Vixen
02b45cc4
csharp
public record class CompiledLibrary

A compiled Raven library: the declarations a consumer binds against, and the lowered IR the bodies emit from. This is what a .rvnlib holds, and what a RavenReference hands to a Compilation.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Two halves, and both are needed for the requirement — "referenced without reparsing source" — to mean anything. The Types half becomes real NamedTypeSymbols that participate in binding, so a call into the library is type-checked exactly as a call within the compilation is. The Ir half is what makes the call emit: the lowerer links the library's functions into the module it is building, so the backend sees a direct call and never learns the callee came from elsewhere.

The link between the two halves is by name — IrFunction and IrStruct. Names rather than indices so a hand-inspected artefact is readable, and so adding a function to a library does not renumber the rest of it.

Fields and properties (4)

  • public required string Name

    The library's name, which is the assembly name of the compilation that produced it.

  • public ImmutableArray<LibraryType> Types

    Every type the library declares, nested types flattened out.

  • public LibraryIr Ir

    The lowered IR the exported bodies are made of.

  • public string SourceHash

    SHA-256 over the sources this was compiled from, so a stale library is detectable without recompiling to compare. Same construction as SourceHash.

Methods (1)

  • public LibraryType? Find(string qualifiedName)

    The type with this qualified name, or null.

Used by (13)

  • CompileDriverVixen.Raven.Cli
  • CompiledLibraryReaderVixen.Raven
  • CompiledLibraryTestsVixen.Raven.Tests
  • CompiledLibraryWriterVixen.Raven
  • InOutTestsVixen.Raven.Tests
  • LibraryBuilderVixen.Raven
  • LibraryTreeTestsVixen.Raven.Tests
  • MetadataLoaderVixen.Raven
  • RavenReferenceVixen.Raven
  • ReferenceLinkVixen.Raven
  • SizedArrayTestsVixen.Raven.Tests
  • StreamTestsVixen.Raven.Tests
  • WritableResourceTestsVixen.Raven.Tests