selfhost: C backend becomes primary backend; QBE path removed from CLI
Major changes:
- Cli_BuildProject now uses CBackend_Generate instead of QBE SSA generation
- Replaced QBE invocation (vendor/qbe/qbe) with direct cc compilation
- Cli_Build (single-file) now compiles C output with cc including runtime.c/io.c
- Added import-based stdlib merging: only imported Std::* modules are merged,
eliminating unused generic code from Array/Map/Set/Channel in simple programs
C backend fixes:
- Fixed struct typedef redefinition: struct definitions now use 'struct Name {}'
instead of 'typedef struct {} Name' to avoid conflicting with forward typedefs
- Added enum support: HirEnum struct, enum emission in C backend, variant
constants emitted as #define Name_Value
- Added char8 typedef
- Skip generic structs/functions (T/K/V type parameters) in C emission
Sema fixes:
- Fixed Sema_IsNumeric: now correctly recognizes uint, float32, float64
- Fixed return type check: allow pointer compatibility (String <-> *T)
Tested: hello, fibonacci, factorial, enums examples build and run via buxc2
This commit is contained in:
@@ -115,6 +115,10 @@ struct HirConst {
|
||||
value: int;
|
||||
}
|
||||
|
||||
struct HirEnum {
|
||||
name: String;
|
||||
}
|
||||
|
||||
struct HirModule {
|
||||
funcCount: int;
|
||||
funcs: *HirFunc;
|
||||
@@ -123,6 +127,7 @@ struct HirModule {
|
||||
structCount: int;
|
||||
structs: *HirStruct;
|
||||
enumCount: int;
|
||||
enums: *HirEnum;
|
||||
constCount: int;
|
||||
consts: *HirConst;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user