Documentation

Common.Diagnostics.Stage

The pipeline's stages, as data.

Lives under Common/ rather than next to the pipeline that runs them (Driver/Pipeline.lean) because two things below the driver need to name a stage without depending on it: the diagnostic registry (Common/Diagnostics/Registry.lean), which records which stage each code comes from, and anything reporting where a compile stopped.

inductive Stage :

Where a compile is, or where it stopped. Constructor order is pipeline order — Stage.reaches compares two stages by it.

Instances For
    @[implicit_reducible]
    Equations
    @[implicit_reducible]
    Equations
    Equations
    Instances For
      @[implicit_reducible]
      Equations
      Equations
      Instances For
        @[implicit_reducible]
        Equations
        Equations
        Instances For
          @[implicit_reducible]
          Equations

          The -d dump-<name>/expectation-file spelling of a stage.

          Equations
          Instances For
            @[implicit_reducible]
            Equations

            What -d dump-<name> writes out for this stage, and none for a stage with nothing worth writing. Four have nothing: read has only the source text the user already has, resolve produces its dependencies' modules rather than one of its own (each dumps itself as it is compiled), and annotation/wellFormedness transform nothing — they check, and hand their input onward unchanged.

            One function rather than a Bool and a separate description because the two answers must agree: fugue help -d lists exactly the stages with an artifact, labelled with what that artifact is. Matched exhaustively on purpose: a stage added later must say what it dumps, rather than defaulting to dumpable and acquiring a -d flag that writes nothing.

            Equations
            Instances For

              Does this stage produce an artifact worth writing out?

              Equations
              Instances For

                The -d dump-<name> option that dumps this stage's artifact. Spelled from name, so the flag, the file it writes (<dump-dir>/<module>-<name>) and the stage a diagnostic reports all use one spelling.

                Equations
                Instances For

                  Every stage, in pipeline order.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    The stage s names, if it names one.

                    Equations
                    Instances For
                      def Stage.reaches (self target : Stage) :

                      Did a compile that reached self get at least as far as target? A plain Bool function rather than an LE/Decidable instance pair: comparing two stages is a question about pipeline progress, and nothing here wants order-class machinery.

                      Equations
                      Instances For