refactor: rename uCodeGen/uCodeGenQBE to blaise.codegen/blaise.codegen.qbe

Align the QBE backend unit names with the dotted naming convention
already used by the native backend (blaise.codegen.native.*).

  uCodeGen.pas    → blaise.codegen.pas
  uCodeGenQBE.pas → blaise.codegen.qbe.pas

Updated all uses clauses (~70 test files, main compiler units),
documentation references (README + 5 docs/*.adoc files), and
comment references in runtime/stdlib.
This commit is contained in:
Graeme Geldenhuys 2026-06-10 12:12:14 +01:00
parent 8119634b0a
commit bb2fe2da75
85 changed files with 96 additions and 96 deletions

View file

@ -133,7 +133,7 @@ project.xml Root aggregator (packaging=pom)
├── compiler/ The compiler binary (packaging=application) ├── compiler/ The compiler binary (packaging=application)
│ ├── project.xml │ ├── project.xml
│ └── src/ │ └── src/
│ ├── main/pascal/ uLexer, uParser, uAST, uCodeGenQBE, blaise.codegen.native.*, ... │ ├── main/pascal/ uLexer, uParser, uAST, blaise.codegen.qbe, blaise.codegen.native.*, ...
│ └── test/pascal/ Test suite (blaise.testing, compiled by Blaise) │ └── test/pascal/ Test suite (blaise.testing, compiled by Blaise)
│ │
├── runtime/ Always-linked runtime (packaging=library) ├── runtime/ Always-linked runtime (packaging=library)

View file

@ -22,7 +22,7 @@ program Blaise;
uses uses
SysUtils, Classes, Process, contnrs, SysUtils, Classes, Process, contnrs,
uLexer, uParser, uAST, uSemantic, uCodeGen, uCodeGenQBE, uLexer, uParser, uAST, uSemantic, blaise.codegen, blaise.codegen.qbe,
blaise.codegen.target, blaise.codegen.native, uToolchain, blaise.codegen.target, blaise.codegen.native, uToolchain,
uUnitLoader, uDebugOPDF, uUnitInterface, uSemanticExport, uSemanticImport, uUnitLoader, uDebugOPDF, uUnitInterface, uSemanticExport, uSemanticImport,
uUnitInterfaceIO, uIfaceObject, uASTDump, uUnitInterfaceIO, uIfaceObject, uASTDump,
@ -966,7 +966,7 @@ begin
explicit `CG := nil` here: the stage-1 release binary mis-compiles an explicit `CG := nil` here: the stage-1 release binary mis-compiles an
explicit nil-assignment to an interface-typed global (emits a bare explicit nil-assignment to an interface-typed global (emits a bare
single-slot store against an undefined $CG symbol). That codegen gap single-slot store against an undefined $CG symbol). That codegen gap
is fixed in this tree (EmitAssign interface-nil case in uCodeGenQBE), is fixed in this tree (EmitAssign interface-nil case in blaise.codegen.qbe),
but stage-1 predates the fix, so the driver must not rely on it. } but stage-1 predates the fix, so the driver must not rely on it. }
if OPDFEnabled then if OPDFEnabled then

View file

@ -33,7 +33,7 @@ unit blaise.codegen.native.backend;
interface interface
uses uses
SysUtils, uAST, uSymbolTable, uCodeGen, strutils, blaise.codegen.target; SysUtils, uAST, uSymbolTable, blaise.codegen, strutils, blaise.codegen.target;
type type
ENativeCodeGenError = class(Exception); ENativeCodeGenError = class(Exception);

View file

@ -31,7 +31,7 @@ unit blaise.codegen.native;
interface interface
uses uses
SysUtils, uAST, uSymbolTable, uCodeGen, SysUtils, uAST, uSymbolTable, blaise.codegen,
blaise.codegen.target, blaise.codegen.native.backend; blaise.codegen.target, blaise.codegen.native.backend;
type type

View file

@ -6,11 +6,11 @@
See LICENSE file in the project root for full license terms. See LICENSE file in the project root for full license terms.
} }
unit uCodeGen; unit blaise.codegen;
{ Backend-neutral code-generator contract. { Backend-neutral code-generator contract.
Both the QBE backend (uCodeGenQBE.TCodeGenQBE) and the native backend Both the QBE backend (blaise.codegen.qbe.TCodeGenQBE) and the native backend
(blaise.codegen.native.TCodeGenNative) implement ICodeGen, so the (blaise.codegen.native.TCodeGenNative) implement ICodeGen, so the
driver in Blaise.pas runs one codegen sequence against the interface driver in Blaise.pas runs one codegen sequence against the interface
rather than branching per backend. rather than branching per backend.

View file

@ -6,7 +6,7 @@
See LICENSE file in the project root for full license terms. See LICENSE file in the project root for full license terms.
} }
unit uCodeGenQBE; unit blaise.codegen.qbe;
{ QBE IR emitter for Blaise. { QBE IR emitter for Blaise.
WriteLn/Write are built-ins emitted as calls to _SysWriteStr/_SysWriteInt/ WriteLn/Write are built-ins emitted as calls to _SysWriteStr/_SysWriteInt/
@ -16,7 +16,7 @@ unit uCodeGenQBE;
interface interface
uses uses
SysUtils, StrUtils, Classes, uAST, uSymbolTable, uStrCompat, uCodeGen, SysUtils, StrUtils, Classes, uAST, uSymbolTable, uStrCompat, blaise.codegen,
blaise.codegen.target; blaise.codegen.target;
// Raw byte copy used by TIRBuffer — maps to libc memcpy. // Raw byte copy used by TIRBuffer — maps to libc memcpy.

View file

@ -83,7 +83,7 @@ implementation
per-class out-helpers. per-class out-helpers.
Typeinfo and methods-table layout are documented in Typeinfo and methods-table layout are documented in
uCodeGenQBE.pas:EmitTypeInfoDefs. blaise.codegen.qbe.pas:EmitTypeInfoDefs.
----------------------------------------------------------------------- } ----------------------------------------------------------------------- }
function PublishedMethodCount(ATestClass: TTestCaseClass): Integer; function PublishedMethodCount(ATestClass: TTestCaseClass): Integer;

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSemantic, blaise.codegen.qbe;
type type
TARCTests = class(TTestCase) TARCTests = class(TTestCase)

View file

@ -20,7 +20,7 @@ interface
uses uses
Classes, SysUtils, Process, blaise.testing, Classes, SysUtils, Process, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
function ProjectRootAttr: string; function ProjectRootAttr: string;
function RunCmdAttr(const AExe: string; const AArgs: array of string): Integer; function RunCmdAttr(const AExe: string; const AArgs: array of string): Integer;

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TBooleanOpsTests = class(TTestCase) TBooleanOpsTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TCaseEnumTests = class(TTestCase) TCaseEnumTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TChainedFieldTests = class(TTestCase) TChainedFieldTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TClassTests = class(TTestCase) TClassTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TClassOfTests = class(TTestCase) TClassOfTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
blaise.testing, blaise.testing,
uLexer, uParser, uAST, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSemantic, blaise.codegen.qbe;
type type
TCodeGenTests = class(TTestCase) TCodeGenTests = class(TTestCase)

View file

@ -27,7 +27,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TCollectionTests = class(TTestCase) TCollectionTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSemantic, blaise.codegen.qbe;
type type
TConstTests = class(TTestCase) TConstTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TControlTests = class(TTestCase) TControlTests = class(TTestCase)

View file

@ -20,7 +20,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TDynArrayTests = class(TTestCase) TDynArrayTests = class(TTestCase)

View file

@ -18,8 +18,8 @@ interface
uses uses
classes, sysutils, process, contnrs, blaise.testing, classes, sysutils, process, contnrs, blaise.testing,
uLexer, uParser, uAST, uSemantic, uCodeGenQBE, uUnitLoader, uLexer, uParser, uAST, uSemantic, blaise.codegen.qbe, uUnitLoader,
uCodeGen, blaise.codegen.target, blaise.codegen.native; blaise.codegen, blaise.codegen.target, blaise.codegen.native;
type type
{ Code-generation backends an e2e test can run against. The native backend { Code-generation backends an e2e test can run against. The native backend

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TExceptionTests = class(TTestCase) TExceptionTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSemantic, blaise.codegen.qbe;
type type
TExternalTests = class(TTestCase) TExternalTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TFlowJumpsTests = class(TTestCase) TFlowJumpsTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TForInTests = class(TTestCase) TForInTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TForTests = class(TTestCase) TForTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TFunctionTests = class(TTestCase) TFunctionTests = class(TTestCase)

View file

@ -17,7 +17,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericConstraintTests = class(TTestCase) TGenericConstraintTests = class(TTestCase)

View file

@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericDefaultsTests = class(TTestCase) TGenericDefaultsTests = class(TTestCase)

View file

@ -22,7 +22,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericForInTests = class(TTestCase) TGenericForInTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericFuncTests = class(TTestCase) TGenericFuncTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericIntfTests = class(TTestCase) TGenericIntfTests = class(TTestCase)

View file

@ -18,7 +18,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericMethodImplTests = class(TTestCase) TGenericMethodImplTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericRecordTests = class(TTestCase) TGenericRecordTests = class(TTestCase)

View file

@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TGenericsTests = class(TTestCase) TGenericsTests = class(TTestCase)

View file

@ -21,7 +21,7 @@ interface
uses uses
blaise.testing, cp.test.e2e.base, blaise.testing, cp.test.e2e.base,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
THighLowTests = class(TTestCase) THighLowTests = class(TTestCase)

View file

@ -19,7 +19,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TIMapTests = class(TTestCase) TIMapTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TInheritTests = class(TTestCase) TInheritTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TInterfaceTests = class(TTestCase) TInterfaceTests = class(TTestCase)

View file

@ -10,7 +10,7 @@ unit cp.test.math;
{ IR-level tests for Math unit functions and math compiler builtins. { IR-level tests for Math unit functions and math compiler builtins.
Builtins (handled in uSemantic + uCodeGenQBE, no RTL unit needed): Builtins (handled in uSemantic + blaise.codegen.qbe, no RTL unit needed):
Abs, Sqrt, Ceil, Floor, Round, Trunc, Ln, Log2, Log10, Power, Abs, Sqrt, Ceil, Floor, Round, Trunc, Ln, Log2, Log10, Power,
Sin, Cos, Tan, ArcTan, ArcTan2, IsNaN, IsInfinite. Sin, Cos, Tan, ArcTan, ArcTan2, IsNaN, IsInfinite.
@ -21,7 +21,7 @@ interface
uses uses
SysUtils, Classes, contnrs, blaise.testing, SysUtils, Classes, contnrs, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE, uUnitLoader; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe, uUnitLoader;
type type
TMathTests = class(TTestCase) TMathTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TMethodTests = class(TTestCase) TMethodTests = class(TTestCase)

View file

@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, Contnrs, blaise.testing, Classes, SysUtils, Contnrs, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE, uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe,
uUnitLoader; uUnitLoader;
type type

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TMultiWriteTests = class(TTestCase) TMultiWriteTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TOpenArrayTests = class(TTestCase) TOpenArrayTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TOverloadTests = class(TTestCase) TOverloadTests = class(TTestCase)

View file

@ -28,7 +28,7 @@ interface
uses uses
blaise.testing, cp.test.e2e.base, blaise.testing, cp.test.e2e.base,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TPackedRecordTests = class(TTestCase) TPackedRecordTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TPCharTests = class(TTestCase) TPCharTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TPointerTests = class(TTestCase) TPointerTests = class(TTestCase)

View file

@ -20,7 +20,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TProcessBuiltinTests = class(TTestCase) TProcessBuiltinTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TProcFuncTests = class(TTestCase) TProcFuncTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSemantic, uSymbolTable, uCodeGenQBE; uLexer, uParser, uAST, uSemantic, uSymbolTable, blaise.codegen.qbe;
type type
TProcTypesTests = class(TTestCase) TProcTypesTests = class(TTestCase)

View file

@ -20,7 +20,7 @@ interface
uses uses
Classes, SysUtils, Process, blaise.testing, Classes, SysUtils, Process, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
function ProjectRootOFO: string; function ProjectRootOFO: string;
function RunCmdOFO(const AExe: string; const AArgs: array of string): Integer; function RunCmdOFO(const AExe: string; const AArgs: array of string): Integer;

View file

@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TPropertyTests = class(TTestCase) TPropertyTests = class(TTestCase)

View file

@ -21,7 +21,7 @@ interface
uses uses
Classes, SysUtils, Process, blaise.testing, Classes, SysUtils, Process, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
function ProjectRootRTTI: string; function ProjectRootRTTI: string;
function RunCmd(const AExe: string; const AArgs: array of string): Integer; function RunCmd(const AExe: string; const AArgs: array of string): Integer;

View file

@ -20,7 +20,7 @@ interface
uses uses
blaise.testing, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE, uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe,
blaise.codegen.target; blaise.codegen.target;
type type

View file

@ -12,7 +12,7 @@ interface
uses uses
blaise.testing, strutils, blaise.testing, strutils,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TRecordTests = class(TTestCase) TRecordTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TRepeatTests = class(TTestCase) TRepeatTests = class(TTestCase)

View file

@ -27,7 +27,7 @@ interface
uses uses
blaise.testing, cp.test.e2e.base, blaise.testing, cp.test.e2e.base,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TSarTests = class(TTestCase) TSarTests = class(TTestCase)

View file

@ -17,7 +17,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TSelfHostingTests = class(TTestCase) TSelfHostingTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TSetTests = class(TTestCase) TSetTests = class(TTestCase)

View file

@ -20,7 +20,7 @@ interface
uses uses
blaise.testing, cp.test.e2e.base, blaise.testing, cp.test.e2e.base,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TSizeOfTests = class(TTestCase) TSizeOfTests = class(TTestCase)

View file

@ -23,7 +23,7 @@ interface
uses uses
blaise.testing, cp.test.e2e.base, blaise.testing, cp.test.e2e.base,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TSmallIntWordTests = class(TTestCase) TSmallIntWordTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TStaticArrayTests = class(TTestCase) TStaticArrayTests = class(TTestCase)

View file

@ -24,7 +24,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TStreamsTests = class(TTestCase) TStreamsTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TStringOpsTests = class(TTestCase) TStringOpsTests = class(TTestCase)

View file

@ -20,7 +20,7 @@ interface
uses uses
SysUtils, Classes, contnrs, blaise.testing, SysUtils, Classes, contnrs, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE, uUnitLoader; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe, uUnitLoader;
type type
TStrUtilsTests = class(TTestCase) TStrUtilsTests = class(TTestCase)

View file

@ -19,7 +19,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTDictionaryTests = class(TTestCase) TTDictionaryTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
blaise.testing, blaise.testing,
uLexer, uParser, uAST, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSemantic, blaise.codegen.qbe;
type type
TThreadVarTests = class(TTestCase) TThreadVarTests = class(TTestCase)

View file

@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTListTests = class(TTestCase) TTListTests = class(TTestCase)

View file

@ -16,7 +16,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTOrderedDictionaryTests = class(TTestCase) TTOrderedDictionaryTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTQueueTests = class(TTestCase) TTQueueTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTSetTests = class(TTestCase) TTSetTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTStackTests = class(TTestCase) TTStackTests = class(TTestCase)

View file

@ -14,7 +14,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TTypeTestTests = class(TTestCase) TTypeTestTests = class(TTestCase)

View file

@ -23,7 +23,7 @@ interface
uses uses
blaise.testing, cp.test.e2e.base, blaise.testing, cp.test.e2e.base,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TUInt64Tests = class(TTestCase) TUInt64Tests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE, uUnitLoader; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe, uUnitLoader;
type type
TUnitTests = class(TTestCase) TUnitTests = class(TTestCase)

View file

@ -15,7 +15,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TVarParamTests = class(TTestCase) TVarParamTests = class(TTestCase)

View file

@ -12,7 +12,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TVTableTests = class(TTestCase) TVTableTests = class(TTestCase)

View file

@ -29,7 +29,7 @@ interface
uses uses
Classes, SysUtils, blaise.testing, Classes, SysUtils, blaise.testing,
uLexer, uParser, uAST, uSymbolTable, uSemantic, uCodeGenQBE; uLexer, uParser, uAST, uSymbolTable, uSemantic, blaise.codegen.qbe;
type type
TWeakRefTests = class(TTestCase) TWeakRefTests = class(TTestCase)

View file

@ -307,7 +307,7 @@ Supported flags:
Units: `uParser.pas`, `uAST.pas`. Units: `uParser.pas`, `uAST.pas`.
. *QBE IR emitter* — traverse AST, emit QBE IR text. Link with `cc`. . *QBE IR emitter* — traverse AST, emit QBE IR text. Link with `cc`.
Unit: `uCodeGenQBE.pas`. Unit: `blaise.codegen.qbe.pas`.
+ +
*Phase 1 pre-work (before parser work begins):* Spend 2–3 weeks writing QBE IR *Phase 1 pre-work (before parser work begins):* Spend 2–3 weeks writing QBE IR
snippets by hand targeting libc to build fluency. QBE variadic calls require snippets by hand targeting libc to build fluency. QBE variadic calls require
@ -567,7 +567,7 @@ build, single combined QBE IR output, no `.ppu` cache.
*Milestone:* `pasbuild test -m blaise-compiler` passes with the compiler compiling *Milestone:* `pasbuild test -m blaise-compiler` passes with the compiler compiling
its own multi-unit source (uLexer, uParser, uAST, uSymbolTable, uSemantic, its own multi-unit source (uLexer, uParser, uAST, uSymbolTable, uSemantic,
uCodeGenQBE, uUnitLoader) via `uses` resolution, producing an identical binary. blaise.codegen.qbe, uUnitLoader) via `uses` resolution, producing an identical binary.
Hand source retired. Hand source retired.
=== Phase 5 — OPDF Integration (previously Phase 4) === Phase 5 — OPDF Integration (previously Phase 4)

View file

@ -20,7 +20,7 @@ in three places*.
. The semantic pass that consumes it (`uSemantic.pas`). . The semantic pass that consumes it (`uSemantic.pas`).
. The `.bif` serialiser and deserialiser (`uUnitInterfaceIO.pas`). . The `.bif` serialiser and deserialiser (`uUnitInterfaceIO.pas`).
Codegen (`uCodeGenQBE.pas`) is a fourth Codegen (`blaise.codegen.qbe.pas`) is a fourth
place, but only when the node carries runtime semantics. A place, but only when the node carries runtime semantics. A
type-system-only change (e.g. adding a marker attribute) may need no type-system-only change (e.g. adding a marker attribute) may need no
codegen work. codegen work.
@ -235,7 +235,7 @@ AnalyseWhenStmt(TWhenStmt(AStmt))`.
=== Step 4: Codegen (QBE Backend) === Step 4: Codegen (QBE Backend)
In `uCodeGenQBE.pas`, add `EmitWhenStmt`. Each branch becomes a guard / In `blaise.codegen.qbe.pas`, add `EmitWhenStmt`. Each branch becomes a guard /
body / next-branch label triple, modelled on `EmitIfStmt`'s expansion. body / next-branch label triple, modelled on `EmitIfStmt`'s expansion.
[source,pascal] [source,pascal]

View file

@ -3033,7 +3033,7 @@ which naturally has a float subexpression and therefore type-checks.
`boDiv`. `uSemantic.pas` (`AnalyseBinaryExpr`) gives `boSlash` a `boDiv`. `uSemantic.pas` (`AnalyseBinaryExpr`) gives `boSlash` a
float result type unconditionally; `boDiv` retains the existing float result type unconditionally; `boDiv` retains the existing
integer-promotion rules and now rejects float operands explicitly. integer-promotion rules and now rejects float operands explicitly.
`uCodeGenQBE.pas` lowers both `boSlash` and `boDiv` to QBE's `div` `blaise.codegen.qbe.pas` lowers both `boSlash` and `boDiv` to QBE's `div`
instruction; the difference is whether the operands have already been instruction; the difference is whether the operands have already been
promoted to a float type (`d`/`s`) on the float arithmetic path. promoted to a float type (`d`/`s`) on the float arithmetic path.

View file

@ -134,7 +134,7 @@ Five categories accepted as "unmangled":
The runtime is hand-written and has *hardcoded* references to specific The runtime is hand-written and has *hardcoded* references to specific
symbol names that originate in these units. Concretely: symbol names that originate in these units. Concretely:
`uCodeGenQBE.pas` emits calls and references like: `blaise.codegen.qbe.pas` emits calls and references like:
* `$_StartUp` (program init, in `System` / `rtl.*`) * `$_StartUp` (program init, in `System` / `rtl.*`)
* `$_SetArgs` * `$_SetArgs`
@ -165,7 +165,7 @@ Two paths to fix this:
. **Route everything through the symbol table** — every `$_Foo` in . **Route everything through the symbol table** — every `$_Foo` in
codegen becomes `RtlSym('_Foo')`, which consults a registry mapping codegen becomes `RtlSym('_Foo')`, which consults a registry mapping
logical names to mangled names. Cleaner long-term; mechanical refactor logical names to mangled names. Cleaner long-term; mechanical refactor
of ~113 call sites in `uCodeGenQBE.pas`. Documented as a follow-up of ~113 call sites in `blaise.codegen.qbe.pas`. Documented as a follow-up
in `memory/project_unit_prefix_mangling.md`. in `memory/project_unit_prefix_mangling.md`.
@ -286,7 +286,7 @@ To add `mynew_rtl_unit` to the allowlist:
---- ----
if SameText(AUnitName, 'mynew_rtl_unit') then Exit; { add this line } if SameText(AUnitName, 'mynew_rtl_unit') then Exit; { add this line }
---- ----
. In `uCodeGenQBE.pas`'s `ClassUnitPrefix`, mirror the same check. . In `blaise.codegen.qbe.pas`'s `ClassUnitPrefix`, mirror the same check.
. Bump `COMPILER_ID` in `uCompilerId.pas` — the change affects which . Bump `COMPILER_ID` in `uCompilerId.pas` — the change affects which
units emit prefixed symbols, so previously-built `.bif`s on disk units emit prefixed symbols, so previously-built `.bif`s on disk
become semantically incompatible. become semantically incompatible.
@ -320,7 +320,7 @@ prebuilt `.o`.
=== Property accessors === Property accessors
Properties don't have their own symbols — they expand at call sites to Properties don't have their own symbols — they expand at call sites to
calls into the read/write method. `uCodeGenQBE`'s property-access calls into the read/write method. `blaise.codegen.qbe`'s property-access
emission inserts the prefix via `ClassUnitPrefix(FldAccess.PropOwnerType)` emission inserts the prefix via `ClassUnitPrefix(FldAccess.PropOwnerType)`
so `MyList.Strings[0]` compiles to a call like so `MyList.Strings[0]` compiles to a call like
`$Classes_TStringList_GetStrings`. `$Classes_TStringList_GetStrings`.

View file

@ -54,7 +54,7 @@ dependencies.
| blaise.testing | blaise.testing
| Parser, semantic analysis, and codegen logic. Feed source strings through | Parser, semantic analysis, and codegen logic. Feed source strings through
the compiler pipeline and assert on generated QBE IR substrings. the compiler pipeline and assert on generated QBE IR substrings.
| Tests import compiler internals (`uParser`, `uSemantic`, `uCodeGenQBE`) and | Tests import compiler internals (`uParser`, `uSemantic`, `blaise.codegen.qbe`) and
run in-process. Fast (~5 s for 1800+ tests). run in-process. Fast (~5 s for 1800+ tests).
| Compiler E2E tests | Compiler E2E tests
@ -93,7 +93,7 @@ module for the following reasons:
Import dependencies:: Import dependencies::
IR tests import compiler internals (`uLexer`, `uParser`, `uAST`, IR tests import compiler internals (`uLexer`, `uParser`, `uAST`,
`uSymbolTable`, `uSemantic`, `uCodeGenQBE`, `uUnitLoader`). Moving them `uSymbolTable`, `uSemantic`, `blaise.codegen.qbe`, `uUnitLoader`). Moving them
to `stdlib/` would create a circular build dependency: stdlib tests would to `stdlib/` would create a circular build dependency: stdlib tests would
depend on the compiler module, while the compiler module already depends on depend on the compiler module, while the compiler module already depends on
stdlib for its unit search path. stdlib for its unit search path.

View file

@ -692,7 +692,7 @@ end;
{ _ClassCreate: runtime equivalent of the inline EmitConstructorCall { _ClassCreate: runtime equivalent of the inline EmitConstructorCall
lowering the codegen produces for the static 'TFoo.Create' form. lowering the codegen produces for the static 'TFoo.Create' form.
Reads totalsize, fieldcleanup pointer, and vtable pointer from the Reads totalsize, fieldcleanup pointer, and vtable pointer from the
expanded class typeinfo (see typeinfo layout in uCodeGenQBE.pas's expanded class typeinfo (see typeinfo layout in blaise.codegen.qbe.pas's
EmitTypeInfoDefs). Allocates an instance, installs the vtable EmitTypeInfoDefs). Allocates an instance, installs the vtable
pointer at slot 0, and bumps the refcount once. pointer at slot 0, and bumps the refcount once.

View file

@ -13,7 +13,7 @@ unit Math;
// Provides numeric utilities for integer and floating-point types. // Provides numeric utilities for integer and floating-point types.
// //
// The following are implemented as compiler builtins (in uSemantic.pas + // The following are implemented as compiler builtins (in uSemantic.pas +
// uCodeGenQBE.pas) and therefore do NOT appear in this unit's interface: // blaise.codegen.qbe.pas) and therefore do NOT appear in this unit's interface:
// Abs, Sqrt, Ceil, Floor, Round, Trunc, Ln, Log2, Log10, Power, // Abs, Sqrt, Ceil, Floor, Round, Trunc, Ln, Log2, Log10, Power,
// Sin, Cos, Tan, ArcTan, ArcTan2, IsNaN, IsInfinite. // Sin, Cos, Tan, ArcTan, ArcTan2, IsNaN, IsInfinite.
// //