All files / PARSE/4-Resolve/types IForeignSymbols.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
import type TCSymbol from "../../../types/symbols/c/TCSymbol";
import type TCppSymbol from "../../../types/symbols/cpp/TCppSymbol";
 
/**
 * The symbols this program's C and C++ headers declare.
 *
 * A shared contract rather than a codegen type: 1.4 Resolve takes it to derive
 * the cross-file facts that are ABOUT foreign declarations — symbol conflicts
 * among them, which header declares a type, opaque-vs-defined — and the
 * orchestrator supplies it. `Program` holds C-Next symbols only, which is why
 * those three facts could not previously be authored there (#1511).
 *
 * The two languages stay separate because their order is observable: a
 * conflict report lists definitions C-Next first, then C, then C++.
 */
interface IForeignSymbols {
  readonly c: ReadonlyArray<TCSymbol>;
  readonly cpp: ReadonlyArray<TCppSymbol>;
 
  /**
   * Typedefs a header declared against a forward-declared struct.
   *
   * The RAW set, not the answer: a typedef is only truly opaque if the tag it
   * names never got a body, and resolving that is `Program`'s job. Handing over
   * a pre-resolved set would leave the derivation outside the artifact, which
   * is the thing #1511 is moving.
   */
  readonly opaqueTypedefs: ReadonlySet<string>;
 
  /** Typedef name to the struct tag it aliases. */
  readonly typedefToTag: ReadonlyMap<string, string>;
 
  /** Struct tags a header gave a full definition. */
  readonly structTagsWithBodies: ReadonlySet<string>;
}
 
export default IForeignSymbols;