Skip to content

Commit

Permalink
Add some comments in check that required some reverse engineering
Browse files Browse the repository at this point in the history
While reading check I had to figure some things out that were not
trivial, and I saved them with comments.
  • Loading branch information
danakj committed Jan 9, 2025
1 parent 831dd2c commit 313b48e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion toolchain/check/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ struct UnitInfo {
: package_id(package_id), node_id(node_id) {}

// The identifier of the imported package.
//
// The current package uses the `IdentifierId::Invalid` id.
IdentifierId package_id;
// The first `import` declaration in the file, which declared the package's
// identifier (even if the import failed). Used for associating diagnostics
Expand Down Expand Up @@ -76,7 +78,8 @@ struct UnitInfo {
// name lookup.
llvm::SmallVector<PackageImports> package_imports;

// A map of the package names to the outgoing imports above.
// A map of the package names to the outgoing imports above. The
// `IdentifierId::Invalid` id refers to the current package.
Map<IdentifierId, int32_t> package_imports_map;

// The remaining number of imports which must be checked before this unit can
Expand Down
2 changes: 2 additions & 0 deletions toolchain/check/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ class Context {
// Per-import constant values. These refer to the main IR and mainly serve as
// a lookup table for quick access.
//
// Indexed by the integer values of the `SemIR::ImportIRId`s in import_irs().
//
// Inline 0 elements because it's expected to require heap allocation.
llvm::SmallVector<SemIR::ConstantValueStore, 0> import_ir_constant_values_;

Expand Down

0 comments on commit 313b48e

Please sign in to comment.