Skip to content

Commit

Permalink
fix i18n script
Browse files Browse the repository at this point in the history
disable llvm
  • Loading branch information
limuy2022 committed Mar 2, 2024
1 parent 7e22a1a commit eb994d6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 61 deletions.
4 changes: 2 additions & 2 deletions cpp/src/TVM/types/trc_long.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ trc_long::trc_long(const std::string& a) {

trc_long::trc_long()
: value((bit_type*)(malloc(size
* sizeof(
bit_type)))) { // 至少申请一个符号位,否则在realloc的过程中会卡死
* sizeof(
bit_type)))) { // 至少申请一个符号位,否则在realloc的过程中会卡死
// 默认为+0
value[0] = 0;
value[1] = 0;
Expand Down
49 changes: 5 additions & 44 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ clap = { version = "4.5.1", features = ["derive"] }
colored = "2.1.0"
downcast-rs = "1.2.0"
num-bigint = "0.4.4"
llvm-sys = "170.0.1"
# llvm-sys = "170.0.1"
derive = { path = "./derive" }
libloading = "0.8.1"
stdlib = { path = "./stdlib" }
Expand Down
22 changes: 11 additions & 11 deletions rust/src/compiler/llvm_convent.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use std::ptr::null_mut;

use llvm_sys::core::{
LLVMAddFunction, LLVMContextCreate, LLVMCreateBuilderInContext, LLVMFunctionType,
LLVMInt32TypeInContext, LLVMModuleCreateWithName,
};
// use llvm_sys::core::{
// LLVMAddFunction, LLVMContextCreate, LLVMCreateBuilderInContext, LLVMFunctionType,
// LLVMInt32TypeInContext, LLVMModuleCreateWithName,
// };

use crate::base::codegen::StaticData;

pub fn convert(tvm_data: StaticData) {
unsafe {
let context = LLVMContextCreate();
let module = LLVMModuleCreateWithName(b"main\0".as_ptr() as *const i8);
let builder = LLVMCreateBuilderInContext(context);
let i32_ty = LLVMInt32TypeInContext(context);
// 创建main函数
let main_ty = LLVMFunctionType(i32_ty, null_mut(), 0, 0);
let main_func = LLVMAddFunction(module, b"main\0".as_ptr() as *const _, main_ty);
// let context = LLVMContextCreate();
// let module = LLVMModuleCreateWithName(b"main\0".as_ptr() as *const i8);
// let builder = LLVMCreateBuilderInContext(context);
// let i32_ty = LLVMInt32TypeInContext(context);
// // 创建main函数
// let main_ty = LLVMFunctionType(i32_ty, null_mut(), 0, 0);
// let main_func = LLVMAddFunction(module, b"main\0".as_ptr() as *const _, main_ty);
}
}
3 changes: 0 additions & 3 deletions script/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/sh

cd cpp/script
python3 gen_locales.py
python3 clang_format.py
cd ../../rust
cargo fmt
cd script
python3 gen_locales.py

0 comments on commit eb994d6

Please sign in to comment.