Skip to main content

Module intern

Module intern 

Source
Expand description

The run’s name table, fed in TLC’s encounter order.

TLC orders strings, model values and record fields by their token in util.UniqueString’s table, and fingerprints a model value by its token. Measured on the pinned TLC (acceptance/ModelDump.java reads the table after TLC has processed the model), the table is filled in this order:

  1. the configuration’s values, strings and model values alike, in the order TLC’s ModelConfig.parse reads them (it runs before SANY). Token 0 is never used, so the first value has token 1;
  2. a fixed set of names SANY creates before it parses (PREFIX in tlc_names.rs);
  3. the image of every token SANY’s lexer reads, file by file in parse order, with SANY’s syntax-node kind names (NODE_KINDS) after the root module’s header line (dive_ir::Ir::lexical_names);
  4. names SANY’s semantic analysis creates: a few internal names, then the contents of string literals as it builds their StringNodes, module by module in semantic-analysis order and in source order within a module (semantic_strings);
  5. strings and names created while TLC runs.

Model values come first, so their tokens are TLC’s exactly. The relative order of every other name is TLC’s as long as SANY does not intern it under a different image (some operator forms) or in a step not listed here; acceptance/README.md records how close the feed is on the corpus.

Functions§

semantic_strings
The contents of every string literal, in the order SANY’s semantic analysis creates their StringNodes (each interns its contents): the file-level modules in semantic-analysis order (the IR’s module order), and within each file in source order (inner modules are analysed where they appear).