| 874 | } |
| 875 | |
| 876 | void BfIRCodeGen::ProcessBfIRData(const BfSizedArray<uint8>& buffer) |
| 877 | { |
| 878 | // Diagnostic handlers were unified in LLVM change 5de2d189e6ad, so starting |
| 879 | // with LLVM 13 this function is gone. |
| 880 | /*struct InlineAsmErrorHook |
| 881 | { |
| 882 | static void StaticHandler(const llvm::SMDiagnostic& diag, void *context, unsigned locCookie) |
| 883 | { |
| 884 | if (diag.getKind() == llvm::SourceMgr::DK_Error) |
| 885 | { |
| 886 | BfIRCodeGen* irCodeGen = (BfIRCodeGen*)context; |
| 887 | |
| 888 | if (!irCodeGen->mErrorMsg.empty()) |
| 889 | irCodeGen->mErrorMsg += "\n"; |
| 890 | irCodeGen->mErrorMsg += StrFormat("Inline assembly error: \"%s\" : %s", diag.getMessage().data(), diag.getLineContents().data()); |
| 891 | } |
| 892 | } |
| 893 | }; |
| 894 | mLLVMContext->setInlineAsmDiagnosticHandler(InlineAsmErrorHook::StaticHandler, this);*/ |
| 895 | |
| 896 | BF_ASSERT(mStream == NULL); |
| 897 | mStream = new ChunkedDataBuffer(); |
| 898 | mStream->InitFlatRef(buffer.mVals, buffer.mSize); |
| 899 | |
| 900 | while (mStream->GetReadPos() < buffer.mSize) |
| 901 | { |
| 902 | if (mFailed) |
| 903 | break; |
| 904 | HandleNextCmd(); |
| 905 | } |
| 906 | |
| 907 | BF_ASSERT((mFailed) || (mStream->GetReadPos() == buffer.mSize)); |
| 908 | } |
| 909 | |
| 910 | int64 BfIRCodeGen::ReadSLEB128() |
| 911 | { |
no test coverage detected