Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Nov 4, 2023
1 parent c68ed74 commit 895a0bb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/llvm/generic_value.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class LLVM::GenericValue
end

def to_i64 : Int64
LibLLVM.generic_value_to_int(self, signed: 1).unsafe_as(Int64)
LibLLVM.generic_value_to_int(self, is_signed: 1).to_i64!
end

def to_u64 : UInt64
LibLLVM.generic_value_to_int(self, signed: 0)
LibLLVM.generic_value_to_int(self, is_signed: 0)
end

def to_b : Bool
Expand Down
28 changes: 14 additions & 14 deletions src/llvm/lib_llvm/initialization.cr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{% skip_file unless LibLLVM::IS_LT_170 %}

require "./types"

lib LibLLVM
{% if LibLLVM::IS_LT_170 %}
fun initialize_core = LLVMInitializeCore(r : PassRegistryRef)
fun initialize_transform_utils = LLVMInitializeTransformUtils(r : PassRegistryRef)
fun initialize_scalar_opts = LLVMInitializeScalarOpts(r : PassRegistryRef)
fun initialize_obj_c_arc_opts = LLVMInitializeObjCARCOpts(r : PassRegistryRef)
fun initialize_vectorization = LLVMInitializeVectorization(r : PassRegistryRef)
fun initialize_inst_combine = LLVMInitializeInstCombine(r : PassRegistryRef)
fun initialize_ipo = LLVMInitializeIPO(r : PassRegistryRef)
fun initialize_instrumentation = LLVMInitializeInstrumentation(r : PassRegistryRef)
fun initialize_analysis = LLVMInitializeAnalysis(r : PassRegistryRef)
fun initialize_ipa = LLVMInitializeIPA(r : PassRegistryRef)
fun initialize_code_gen = LLVMInitializeCodeGen(r : PassRegistryRef)
fun initialize_target = LLVMInitializeTarget(r : PassRegistryRef)
{% end %}
fun initialize_core = LLVMInitializeCore(r : PassRegistryRef)
fun initialize_transform_utils = LLVMInitializeTransformUtils(r : PassRegistryRef)
fun initialize_scalar_opts = LLVMInitializeScalarOpts(r : PassRegistryRef)
fun initialize_obj_c_arc_opts = LLVMInitializeObjCARCOpts(r : PassRegistryRef)
fun initialize_vectorization = LLVMInitializeVectorization(r : PassRegistryRef)
fun initialize_inst_combine = LLVMInitializeInstCombine(r : PassRegistryRef)
fun initialize_ipo = LLVMInitializeIPO(r : PassRegistryRef)
fun initialize_instrumentation = LLVMInitializeInstrumentation(r : PassRegistryRef)
fun initialize_analysis = LLVMInitializeAnalysis(r : PassRegistryRef)
fun initialize_ipa = LLVMInitializeIPA(r : PassRegistryRef)
fun initialize_code_gen = LLVMInitializeCodeGen(r : PassRegistryRef)
fun initialize_target = LLVMInitializeTarget(r : PassRegistryRef)
end
12 changes: 6 additions & 6 deletions src/llvm/lib_llvm/transforms/pass_builder.cr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% skip_file if LibLLVM::IS_LT_130 %}

require "../target_machine"
require "../types"

lib LibLLVM
{% unless LibLLVM::IS_LT_130 %}
type PassBuilderOptionsRef = Void*
type PassBuilderOptionsRef = Void*

fun run_passes = LLVMRunPasses(m : ModuleRef, passes : Char*, tm : TargetMachineRef, options : PassBuilderOptionsRef) : ErrorRef
fun run_passes = LLVMRunPasses(m : ModuleRef, passes : Char*, tm : TargetMachineRef, options : PassBuilderOptionsRef) : ErrorRef

fun create_pass_builder_options = LLVMCreatePassBuilderOptions : PassBuilderOptionsRef
fun dispose_pass_builder_options = LLVMDisposePassBuilderOptions(options : PassBuilderOptionsRef)
{% end %}
fun create_pass_builder_options = LLVMCreatePassBuilderOptions : PassBuilderOptionsRef
fun dispose_pass_builder_options = LLVMDisposePassBuilderOptions(options : PassBuilderOptionsRef)
end
24 changes: 12 additions & 12 deletions src/llvm/lib_llvm/transforms/pass_manager_builder.cr
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{% skip_file unless LibLLVM::IS_LT_170 %}

require "../types"

lib LibLLVM
{% if LibLLVM::IS_LT_170 %}
type PassManagerBuilderRef = Void*
type PassManagerBuilderRef = Void*

fun pass_manager_builder_create = LLVMPassManagerBuilderCreate : PassManagerBuilderRef
fun dispose_pass_manager_builder = LLVMPassManagerBuilderDispose(pmb : PassManagerBuilderRef)
fun pass_manager_builder_set_opt_level = LLVMPassManagerBuilderSetOptLevel(pmb : PassManagerBuilderRef, opt_level : UInt)
fun pass_manager_builder_set_size_level = LLVMPassManagerBuilderSetSizeLevel(pmb : PassManagerBuilderRef, size_level : UInt)
fun pass_manager_builder_set_disable_unroll_loops = LLVMPassManagerBuilderSetDisableUnrollLoops(pmb : PassManagerBuilderRef, value : Bool)
fun pass_manager_builder_set_disable_simplify_lib_calls = LLVMPassManagerBuilderSetDisableSimplifyLibCalls(pmb : PassManagerBuilderRef, value : Bool)
fun pass_manager_builder_use_inliner_with_threshold = LLVMPassManagerBuilderUseInlinerWithThreshold(pmb : PassManagerBuilderRef, threshold : UInt)
fun pass_manager_builder_populate_function_pass_manager = LLVMPassManagerBuilderPopulateFunctionPassManager(pmb : PassManagerBuilderRef, pm : PassManagerRef)
fun pass_manager_builder_populate_module_pass_manager = LLVMPassManagerBuilderPopulateModulePassManager(pmb : PassManagerBuilderRef, pm : PassManagerRef)
{% end %}
fun pass_manager_builder_create = LLVMPassManagerBuilderCreate : PassManagerBuilderRef
fun dispose_pass_manager_builder = LLVMPassManagerBuilderDispose(pmb : PassManagerBuilderRef)
fun pass_manager_builder_set_opt_level = LLVMPassManagerBuilderSetOptLevel(pmb : PassManagerBuilderRef, opt_level : UInt)
fun pass_manager_builder_set_size_level = LLVMPassManagerBuilderSetSizeLevel(pmb : PassManagerBuilderRef, size_level : UInt)
fun pass_manager_builder_set_disable_unroll_loops = LLVMPassManagerBuilderSetDisableUnrollLoops(pmb : PassManagerBuilderRef, value : Bool)
fun pass_manager_builder_set_disable_simplify_lib_calls = LLVMPassManagerBuilderSetDisableSimplifyLibCalls(pmb : PassManagerBuilderRef, value : Bool)
fun pass_manager_builder_use_inliner_with_threshold = LLVMPassManagerBuilderUseInlinerWithThreshold(pmb : PassManagerBuilderRef, threshold : UInt)
fun pass_manager_builder_populate_function_pass_manager = LLVMPassManagerBuilderPopulateFunctionPassManager(pmb : PassManagerBuilderRef, pm : PassManagerRef)
fun pass_manager_builder_populate_module_pass_manager = LLVMPassManagerBuilderPopulateModulePassManager(pmb : PassManagerBuilderRef, pm : PassManagerRef)
end

0 comments on commit 895a0bb

Please sign in to comment.