aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-08-09 15:36:18 +0100
committergingerBill <bill@gingerbill.org>2022-08-09 15:36:18 +0100
commitcb0a59bb2cfdeb971e88f329f07783ba1f93a5c9 (patch)
tree1996d06dc99ef64112515cb4bd3e0a3853850f9f /src/llvm_abi.cpp
parent076700bd226aa620e8f6c45e6d9ad5a660299144 (diff)
Eliminate use of LLVMGetElementType for pointers
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index b22a839b3..2ff55c79b 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -62,7 +62,7 @@ bool lb_is_type_kind(LLVMTypeRef type, LLVMTypeKind kind) {
return LLVMGetTypeKind(type) == kind;
}
-LLVMTypeRef lb_function_type_to_llvm_ptr(lbFunctionType *ft, bool is_var_arg) {
+LLVMTypeRef lb_function_type_to_llvm_raw(lbFunctionType *ft, bool is_var_arg) {
unsigned arg_count = cast(unsigned)ft->args.count;
unsigned offset = 0;
@@ -108,10 +108,16 @@ LLVMTypeRef lb_function_type_to_llvm_ptr(lbFunctionType *ft, bool is_var_arg) {
}
unsigned total_arg_count = arg_index;
LLVMTypeRef func_type = LLVMFunctionType(ret, args, total_arg_count, is_var_arg);
- return LLVMPointerType(func_type, 0);
+ return func_type;
}
+// LLVMTypeRef lb_function_type_to_llvm_ptr(lbFunctionType *ft, bool is_var_arg) {
+// LLVMTypeRef func_type = lb_function_type_to_llvm_raw(ft, is_var_arg);
+// return LLVMPointerType(func_type, 0);
+// }
+
+
void lb_add_function_type_attributes(LLVMValueRef fn, lbFunctionType *ft, ProcCallingConvention calling_convention) {
if (ft == nullptr) {
return;