| 559 | } |
| 560 | |
| 561 | BfTypeCode 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 | |
| 588 | llvm::Type* BfIRCodeGen::GetLLVMType(BfTypeCode typeCode, bool& isSigned) |
| 589 | { |
no outgoing calls
no test coverage detected