Skip to content

clore::extract::ensure_cache_key_impl

Owner: Module extract:compiler

Declaration: extract/compiler.cppm:119

Definition: extract/compiler.cppm:119

Declaration: Namespace clore::extract

Implementation

cpp
auto ensure_cache_key_impl(CompileEntry& entry) -> void {
    entry.normalized_file = normalize_entry_file(entry);
    entry.compile_signature = build_compile_signature_impl(entry, entry.normalized_file);
    entry.source_hash = try_hash_source_file(entry.normalized_file);
    entry.cache_key =
        clore::support::build_cache_key(entry.normalized_file, entry.compile_signature);
}

The function clore::extract::ensure_cache_key_impl computes and stores the caching metadata for a given CompileEntry. It begins by obtaining a normalized file path via clore::extract::normalize_entry_file, storing the result into the normalized_file field. Next, it derives a compile signature by calling clore::extract::(anonymous namespace)::build_compile_signature_impl with the entry and the normalized path, saving the result into compile_signature. An optional source file hash is produced by clore::extract::(anonymous namespace)::try_hash_source_file using the normalized file, and that heuristics result is written to source_hash. Finally, the function assembles the cache_key by invoking clore::support::build_cache_key with the normalized file and the compile signature. The control flow is strictly sequential; each step depends on the output of the previous one, and all key values are later used by the caching and lookup mechanisms.

Side Effects

  • mutates entry fields: normalized_file, compile_signature, source_hash, cache_key
  • potentially reads source file via try_hash_source_file

Reads From

  • entry (CompileEntry& parameter)

Writes To

  • entry.normalized_file
  • entry.compile_signature
  • entry.source_hash
  • entry.cache_key

Usage Patterns

  • called by ensure_cache_key to populate cache key for a compile entry

Calls

  • function clore::extract::(anonymous namespace)::build_compile_signature_impl
  • function clore::extract::(anonymous namespace)::try_hash_source_file
  • function clore::extract::normalize_entry_file

Called By

  • function clore::extract::ensure_cache_key