From a5bc19c8970e21535466494cb9e12324509b2e0a Mon Sep 17 00:00:00 2001 From: Mattthew Heath Date: Sun, 7 Jul 2024 22:37:17 +0100 Subject: [PATCH] Adds case staements for lowlevel to compile --- crates/compiler/gen_llvm/src/llvm/lowlevel.rs | 11 +++++++++++ crates/compiler/module/src/symbol.rs | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/compiler/gen_llvm/src/llvm/lowlevel.rs b/crates/compiler/gen_llvm/src/llvm/lowlevel.rs index 6ddcad1f7e1..c68877ca8bb 100644 --- a/crates/compiler/gen_llvm/src/llvm/lowlevel.rs +++ b/crates/compiler/gen_llvm/src/llvm/lowlevel.rs @@ -1409,6 +1409,17 @@ pub(crate) fn run_low_level<'a, 'ctx>( call_bitcode_fn(env, &[], bitcode::UTILS_DICT_PSEUDO_SEED) } + CryptEmptySha256 => { + call_bitcode_fn(env, &[], bitcode::CRYPT_EMPTY_SHA256) + } + CryptAddBytes => { + arguments!(sha, data); + call_bitcode_fn(env, &[sha, data], bitcode::CRYPT_ADD_BYTES) + } + CryptDigest => { + arguments!(sha); + call_bitcode_fn(env, &[sha], bitcode::CRYPT_DIGEST) + } ListIncref | ListDecref | SetJmp | LongJmp | SetLongJmpBuffer => { unreachable!("only inserted in dev backend codegen") diff --git a/crates/compiler/module/src/symbol.rs b/crates/compiler/module/src/symbol.rs index 1a8f49a8a53..0e4f3eeabbd 100644 --- a/crates/compiler/module/src/symbol.rs +++ b/crates/compiler/module/src/symbol.rs @@ -1688,10 +1688,10 @@ define_builtins! { 15 CRYPT: "Crypt" =>{ 0 CRYPT_SHA256: "Sha256" exposed_type=true 1 CRYPT_EMPTY_STRUCT: "EmptyStruct" exposed_type=true - 3 CRYPT_DIGEST256: "Digest256" exposed_type=true - 4 CRYPT_EMPTY_SHA256: "emptySha256" - 5 CRYPT_ADD_BYTES: "addBytes" - 6 CRYPT_DIGEST: "digest" + 2 CRYPT_DIGEST256: "Digest256" exposed_type=true + 3 CRYPT_EMPTY_SHA256: "emptySha256" + 4 CRYPT_ADD_BYTES: "addBytes" + 5 CRYPT_DIGEST: "digest" } num_modules: 17 // Keep this count up to date by hand! (TODO: see the mut_map! macro for how we could determine this count correctly in the macro)