aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-03-25 22:59:15 +0000
committergingerBill <bill@gingerbill.org>2021-03-25 22:59:15 +0000
commit7463ad23d84643e44635b4601d8632d0f6281d5a (patch)
tree6b3759de5de28c7b5616c7c3c387cc8931d2ad99 /src
parent6271d10af7f06ff9d740dc9da718d0f59585bea0 (diff)
Move variable declarations to aid other compilers
Diffstat (limited to 'src')
-rw-r--r--src/llvm_backend.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index c4babd11e..e7ba224b3 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -2814,7 +2814,6 @@ void lb_start_block(lbProcedure *p, lbBlock *b) {
LLVMValueRef OdinLLVMBuildTransmute(lbProcedure *p, LLVMValueRef val, LLVMTypeRef dst_type) {
LLVMContextRef ctx = p->module->ctx;
-
LLVMTypeRef src_type = LLVMTypeOf(val);
if (src_type == dst_type) {
@@ -2823,6 +2822,8 @@ LLVMValueRef OdinLLVMBuildTransmute(lbProcedure *p, LLVMValueRef val, LLVMTypeRe
i64 src_size = lb_sizeof(src_type);
i64 dst_size = lb_sizeof(dst_type);
+ LLVMTypeKind src_kind = LLVMGetTypeKind(src_type);
+ LLVMTypeKind dst_kind = LLVMGetTypeKind(dst_type);
if (dst_type == LLVMInt1TypeInContext(ctx)) {
GB_ASSERT(lb_is_type_kind(src_type, LLVMIntegerTypeKind));
@@ -2840,8 +2841,7 @@ LLVMValueRef OdinLLVMBuildTransmute(lbProcedure *p, LLVMValueRef val, LLVMTypeRe
}
}
- LLVMTypeKind src_kind = LLVMGetTypeKind(src_type);
- LLVMTypeKind dst_kind = LLVMGetTypeKind(dst_type);
+
if (src_kind == dst_kind) {
if (src_kind == LLVMPointerTypeKind) {
return LLVMBuildPointerCast(p->builder, val, dst_type, "");