aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-03-19 15:47:10 +0000
committergingerBill <bill@gingerbill.org>2021-03-19 15:47:10 +0000
commit178e891c78081a52c6c7a9cd8b66a977e245c387 (patch)
tree9df3196d5bfa651be6df214eb667394515d9b4b4 /src/llvm_abi.cpp
parentbda9eb73480967b83e2c38b5ebd948f88321cd2e (diff)
Fix some LLVM asserts by using LLVMConstNamedStruct everywhere
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 217e00a2e..5c72c0345 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -107,9 +107,9 @@ void lb_add_function_type_attributes(LLVMValueRef fn, lbFunctionType *ft, ProcCa
}
LLVMContextRef c = ft->ctx;
- LLVMAttributeRef noalias_attr = lb_create_enum_attribute(c, "noalias", true);
- LLVMAttributeRef nonnull_attr = lb_create_enum_attribute(c, "nonnull", true);
- LLVMAttributeRef nocapture_attr = lb_create_enum_attribute(c, "nocapture", true);
+ LLVMAttributeRef noalias_attr = lb_create_enum_attribute(c, "noalias");
+ LLVMAttributeRef nonnull_attr = lb_create_enum_attribute(c, "nonnull");
+ LLVMAttributeRef nocapture_attr = lb_create_enum_attribute(c, "nocapture");
unsigned arg_index = offset;
for (unsigned i = 0; i < arg_count; i++) {
@@ -412,7 +412,7 @@ namespace lbAbi386 {
LLVMAttributeRef attr = nullptr;
LLVMTypeRef i1 = LLVMInt1TypeInContext(c);
if (type == i1) {
- attr = lb_create_enum_attribute(c, "zeroext", true);
+ attr = lb_create_enum_attribute(c, "zeroext");
}
return lb_arg_type_direct(type, nullptr, nullptr, attr);
}
@@ -428,7 +428,7 @@ namespace lbAbi386 {
if (sz == 0) {
args[i] = lb_arg_type_ignore(t);
} else {
- args[i] = lb_arg_type_indirect(t, lb_create_enum_attribute(c, "byval", true));
+ args[i] = lb_arg_type_indirect(t, lb_create_enum_attribute(c, "byval"));
}
} else {
args[i] = non_struct(c, t, false);
@@ -448,7 +448,7 @@ namespace lbAbi386 {
case 4: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 32), nullptr, nullptr);
case 8: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 64), nullptr, nullptr);
}
- LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret", true);
+ LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret");
return lb_arg_type_indirect(return_type, attr);
}
return non_struct(c, return_type, true);
@@ -596,7 +596,7 @@ namespace lbAbiAmd64SysV {
if (is_register(type)) {
LLVMAttributeRef attribute = nullptr;
if (type == LLVMInt1TypeInContext(c)) {
- attribute = lb_create_enum_attribute(c, "zeroext", true);
+ attribute = lb_create_enum_attribute(c, "zeroext");
}
return lb_arg_type_direct(type, nullptr, nullptr, attribute);
}
@@ -605,9 +605,9 @@ namespace lbAbiAmd64SysV {
if (is_mem_cls(cls, attribute_kind)) {
LLVMAttributeRef attribute = nullptr;
if (attribute_kind == Amd64TypeAttribute_ByVal) {
- attribute = lb_create_enum_attribute(c, "byval", true);
+ attribute = lb_create_enum_attribute(c, "byval");
} else if (attribute_kind == Amd64TypeAttribute_StructRect) {
- attribute = lb_create_enum_attribute(c, "sret", true);
+ attribute = lb_create_enum_attribute(c, "sret");
}
return lb_arg_type_indirect(type, attribute);
} else {
@@ -619,7 +619,7 @@ namespace lbAbiAmd64SysV {
LLVMAttributeRef attr = nullptr;
LLVMTypeRef i1 = LLVMInt1TypeInContext(c);
if (type == i1) {
- attr = lb_create_enum_attribute(c, "zeroext", true);
+ attr = lb_create_enum_attribute(c, "zeroext");
}
return lb_arg_type_direct(type, nullptr, nullptr, attr);
}
@@ -886,7 +886,7 @@ namespace lbAbiAmd64SysV {
if (sz == 0) {
args[i] = lb_arg_type_ignore(t);
} else {
- args[i] = lb_arg_type_indirect(t, lb_create_enum_attribute(c, "byval", true));
+ args[i] = lb_arg_type_indirect(t, lb_create_enum_attribute(c, "byval"));
}
} else {
args[i] = non_struct(c, t);
@@ -906,7 +906,7 @@ namespace lbAbiAmd64SysV {
case 4: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 32), nullptr, nullptr);
case 8: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 64), nullptr, nullptr);
}
- LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret", true);
+ LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret");
return lb_arg_type_indirect(return_type, attr);
} else if (build_context.metrics.os == TargetOs_windows && lb_is_type_kind(return_type, LLVMIntegerTypeKind) && lb_sizeof(return_type) == 16) {
return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 128), nullptr, nullptr);
@@ -946,7 +946,7 @@ namespace lbAbiArm64 {
LLVMAttributeRef attr = nullptr;
LLVMTypeRef i1 = LLVMInt1TypeInContext(c);
if (type == i1) {
- attr = lb_create_enum_attribute(c, "zeroext", true);
+ attr = lb_create_enum_attribute(c, "zeroext");
}
return lb_arg_type_direct(type, nullptr, nullptr, attr);
}
@@ -1055,7 +1055,7 @@ namespace lbAbiArm64 {
}
return lb_arg_type_direct(type, cast_type, nullptr, nullptr);
} else {
- LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret", true);
+ LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret");
return lb_arg_type_indirect(type, attr);
}
}