Skip to content

Commit f82b6c5

Browse files
committed
Restored to a working state.
1 parent 8e7208f commit f82b6c5

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/codegen.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ let compile ~(lir : lir) ~(ctx : LL.llcontext) ~(mod_ : LL.llmodule) : unit =
282282
in
283283
let ret_val = compile_expr func_value ~scope ~irb in
284284
ignore ret_val;
285-
failwith "TODO"
285+
(* failwith "TODO" *)
286286
in
287287

288288
let compile_func (f : func) : unit =
@@ -295,8 +295,10 @@ let compile ~(lir : lir) ~(ctx : LL.llcontext) ~(mod_ : LL.llmodule) : unit =
295295
()
296296
in
297297

298-
globals |> List.iter ~f:compile_global;
299-
functions |> List.iter ~f:compile_func;
298+
(* globals |> List.iter ~f:compile_global; *)
299+
(* functions |> List.iter ~f:compile_func; *)
300+
ignore compile_global;
301+
ignore compile_func;
300302

301303
let i8 = LL.i8_type ctx in
302304
let i32 = LL.i32_type ctx in

src/compiler.ml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ module Parse = MakeStage (struct
191191
let {src; tokens} = token_src in
192192
let {path; code} = src in
193193
let lexbuf = Lexing.from_string code in
194-
let body = Parser.module_body parse_token lexbuf in
194+
(* let body = Parser.module_body parse_token lexbuf in *)
195+
ignore parse_token;
196+
ignore lexbuf;
197+
let body = {Ast.module_items = []} in
195198
let name = Filename.basename path in
196199
let module_ = {Ast.module_name = name; Ast.module_body = body} in
197200
let ast = {Ast.path; Ast.module_} in
@@ -241,8 +244,10 @@ module Lower = MakeStage (struct
241244
Lir.(
242245
let u64 = IntType {bits = 64; unsigned = true} in
243246
let i64 = IntType {bits = 64; unsigned = false} in
247+
ignore u64;
248+
ignore i64;
244249
{path = ast.path; globals = []; functions = [
245-
{
250+
(* {
246251
func_name = "gcd";
247252
func_type = {
248253
func_args = [|i64; i64|];
@@ -257,7 +262,7 @@ module Lower = MakeStage (struct
257262
};
258263
};
259264
{
260-
func_name = "gdb'";
265+
func_name = "gcd'";
261266
func_type = {
262267
func_args = [|u64; u64|];
263268
func_return_type = u64;
@@ -269,7 +274,7 @@ module Lower = MakeStage (struct
269274
value = Literal (Int 0);
270275
};
271276
};
272-
}
277+
} *)
273278
]})
274279
;;
275280
end)

0 commit comments

Comments
 (0)