Skip to content

Commit

Permalink
feat: add wasm32 llvm target (#1262)
Browse files Browse the repository at this point in the history
feat:add wasm32 llvm target

Signed-off-by: shruti2522 <[email protected]>
  • Loading branch information
shruti2522 authored Apr 30, 2024
1 parent a1bc5a2 commit 369a5c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kclvm/compiler/src/codegen/llvm/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ pub fn emit_code(
) -> Result<(), Box<dyn error::Error>> {
// Init LLVM targets
LLVM_INIT.get_or_init(|| {
// TODO: WASM target.
#[cfg(target_os = "linux")]
inkwell::targets::Target::initialize_x86(&Default::default());
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
inkwell::targets::Target::initialize_aarch64(&Default::default());
#[cfg(not(target_os = "linux"))]
#[cfg(target_arch = "wasm32")]
inkwell::targets::Target::initialize_webassembly(&Default::default());
#[cfg(not(any(target_os = "linux", target_arch = "wasm32")))]
inkwell::targets::Target::initialize_all(&Default::default());
});
// Create a LLVM context
Expand Down

0 comments on commit 369a5c3

Please sign in to comment.