From 2c838ab845bc54c5ef6cb0561332c84f34249368 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 19 Mar 2021 20:46:19 -0400 Subject: feat(gs/achilles): Implement extern decls, for glibc functions Implement extern decls, which codegen to LLVM as forward-declared functions, and use these as a hook into calling glibc functions. We can print to the terminal now! The integration tests can test this now. Change-Id: I70af4546b417b888ad9fbb18798db240f77f4e71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2614 Tested-by: BuildkiteCI Reviewed-by: glittershark --- users/glittershark/achilles/src/ast/mod.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'users/glittershark/achilles/src/ast/mod.rs') diff --git a/users/glittershark/achilles/src/ast/mod.rs b/users/glittershark/achilles/src/ast/mod.rs index 3a2261aeda23..22d16c93645c 100644 --- a/users/glittershark/achilles/src/ast/mod.rs +++ b/users/glittershark/achilles/src/ast/mod.rs @@ -265,8 +265,18 @@ impl<'a> Fun<'a> { #[derive(Debug, PartialEq, Eq, Clone)] pub enum Decl<'a> { - Fun { name: Ident<'a>, body: Fun<'a> }, - Ascription { name: Ident<'a>, type_: Type<'a> }, + Fun { + name: Ident<'a>, + body: Fun<'a>, + }, + Ascription { + name: Ident<'a>, + type_: Type<'a>, + }, + Extern { + name: Ident<'a>, + type_: FunctionType<'a>, + }, } //// -- cgit 1.4.1