mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Renamed TypeCode_Single to TypeCode_Float. Float struct interop fixes.
This commit is contained in:
parent
14c3d0cd35
commit
2fe209447e
20 changed files with 595 additions and 69 deletions
|
@ -420,7 +420,7 @@ BfTypeCode BfIRCodeGen::GetTypeCode(llvm::Type* type, bool isSigned)
|
|||
}
|
||||
|
||||
if (type->isFloatingPointTy())
|
||||
return BfTypeCode_Single;
|
||||
return BfTypeCode_Float;
|
||||
if (type->isDoubleTy())
|
||||
return BfTypeCode_Double;
|
||||
|
||||
|
@ -509,10 +509,12 @@ llvm::Type* BfIRCodeGen::GetLLVMType(BfTypeCode typeCode, bool& isSigned)
|
|||
return llvm::Type::getInt32Ty(*mLLVMContext);
|
||||
else
|
||||
return llvm::Type::getInt64Ty(*mLLVMContext);*/
|
||||
case BfTypeCode_Single:
|
||||
case BfTypeCode_Float:
|
||||
return llvm::Type::getFloatTy(*mLLVMContext);
|
||||
case BfTypeCode_Double:
|
||||
return llvm::Type::getDoubleTy(*mLLVMContext);
|
||||
case BfTypeCode_Float2:
|
||||
return llvm::VectorType::get(llvm::Type::getFloatTy(*mLLVMContext), 2);
|
||||
default: break;
|
||||
}
|
||||
return NULL;
|
||||
|
@ -826,7 +828,7 @@ void BfIRCodeGen::Read(llvm::Value*& llvmValue, BfIRCodeGenEntry** codeGenEntry)
|
|||
bool isSigned;
|
||||
llvm::Type* llvmConstType = GetLLVMType(typeCode, isSigned);
|
||||
|
||||
if (typeCode == BfTypeCode_Single)
|
||||
if (typeCode == BfTypeCode_Float)
|
||||
{
|
||||
float f;
|
||||
mStream->Read(&f, sizeof(float));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue