MCPcopy Create free account
hub / github.com/beefytech/Beef / GetTypeCode

Method GetTypeCode

IDEHelper/Compiler/BfIRCodeGen.cpp:561–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561BfTypeCode BfIRCodeGen::GetTypeCode(llvm::Type* type, bool isSigned)
562{
563 if (type->isIntegerTy())
564 {
565 switch (type->getIntegerBitWidth())
566 {
567 case 1:
568 return BfTypeCode_Boolean;
569 case 8:
570 return isSigned ? BfTypeCode_Int8 : BfTypeCode_UInt8;
571 case 16:
572 return isSigned ? BfTypeCode_Int16 : BfTypeCode_UInt16;
573 case 32:
574 return isSigned ? BfTypeCode_Int32 : BfTypeCode_UInt32;
575 case 64:
576 return isSigned ? BfTypeCode_Int64 : BfTypeCode_UInt64;
577 }
578 }
579
580 if (type->isFloatingPointTy())
581 return BfTypeCode_Float;
582 if (type->isDoubleTy())
583 return BfTypeCode_Double;
584
585 return BfTypeCode_None;
586}
587
588llvm::Type* BfIRCodeGen::GetLLVMType(BfTypeCode typeCode, bool& isSigned)
589{

Callers 4

TypedValueToVariantMethod · 0.45
DataToStringMethod · 0.45
LookupTypePropMethod · 0.45
EvaluateToVariantMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected