Fix load type not initialized issue for LLVMBuildLoad2 (#1381)

Fix the issue introduced by #1202, clear the compilation warning
when building wamrc based on LLVM 14/15.
This commit is contained in:
Wenyong Huang 2022-08-12 14:18:47 +08:00 committed by GitHub
parent 2178787664
commit b65befd5e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2735,11 +2735,13 @@ aot_load_const_from_table(AOTCompContext *comp_ctx, LLVMValueRef base,
/* Store the raw int bits of i32 const as a hex string */ /* Store the raw int bits of i32 const as a hex string */
snprintf(buf, sizeof(buf), "i32#%08" PRIX32, value->i32); snprintf(buf, sizeof(buf), "i32#%08" PRIX32, value->i32);
const_ptr_type = INT32_PTR_TYPE; const_ptr_type = INT32_PTR_TYPE;
const_type = I32_TYPE;
break; break;
case VALUE_TYPE_I64: case VALUE_TYPE_I64:
/* Store the raw int bits of i64 const as a hex string */ /* Store the raw int bits of i64 const as a hex string */
snprintf(buf, sizeof(buf), "i64#%016" PRIX64, value->i64); snprintf(buf, sizeof(buf), "i64#%016" PRIX64, value->i64);
const_ptr_type = INT64_PTR_TYPE; const_ptr_type = INT64_PTR_TYPE;
const_type = I64_TYPE;
break; break;
case VALUE_TYPE_F32: case VALUE_TYPE_F32:
/* Store the raw int bits of f32 const as a hex string */ /* Store the raw int bits of f32 const as a hex string */