Skip to content

Commit 361fbb0

Browse files
committed
LLVMCodeBuilder: Fix ValueData definition
1 parent 833565b commit 361fbb0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/dev/engine/internal/llvmcodebuilder.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -546,19 +546,11 @@ void LLVMCodeBuilder::yield()
546546
void LLVMCodeBuilder::initTypes()
547547
{
548548
// Create the ValueData struct
549-
llvm::Type *doubleType = llvm::Type::getDoubleTy(m_ctx); // double (numberValue)
550-
llvm::Type *boolType = llvm::Type::getInt1Ty(m_ctx); // bool (boolValue)
551-
llvm::Type *stringPtrType = llvm::PointerType::get(llvm::Type::getInt8Ty(m_ctx), 0); // char* (stringValue)
549+
llvm::Type *unionType = m_builder.getInt64Ty(); // 64 bits is the largest size
552550

553-
// Create the union type (largest type size should dominate)
554-
llvm::StructType *unionType = llvm::StructType::create(m_ctx, "union");
555-
unionType->setBody({ doubleType, boolType, stringPtrType });
556-
557-
// Create the full struct type
558551
llvm::Type *valueType = llvm::Type::getInt32Ty(m_ctx); // Assuming ValueType is a 32-bit enum
559552
llvm::Type *sizeType = llvm::Type::getInt64Ty(m_ctx); // size_t
560553

561-
// Combine them into the full struct
562554
m_valueDataType = llvm::StructType::create(m_ctx, "ValueData");
563555
m_valueDataType->setBody({ unionType, valueType, sizeType });
564556
}

0 commit comments

Comments
 (0)