LCOV - code coverage report
Current view: top level - asmjit - globals.cpp (source / functions) Hit Total Coverage
Test: plumed test coverage (other modules) Lines: 0 8 0.0 %
Date: 2026-11-05 10:19:06 Functions: 0 3 0.0 %

          Line data    Source code
       1             : #ifdef __PLUMED_HAS_ASMJIT
       2             : // This file is part of AsmJit project <https://asmjit.com>
       3             : //
       4             : // See asmjit.h or LICENSE.md for license and copyright information
       5             : // SPDX-License-Identifier: Zlib
       6             : 
       7             : #include "api-build_p.h"
       8             : #include "globals.h"
       9             : #include "support.h"
      10             : 
      11             : ASMJIT_BEGIN_NAMESPACE
      12             : 
      13             : // DebugUtils - Error As String
      14             : // ============================
      15             : 
      16           0 : ASMJIT_FAVOR_SIZE const char* DebugUtils::errorAsString(Error err) noexcept {
      17             : #ifndef ASMJIT_NO_TEXT
      18             :   // @EnumStringBegin{"enum": "ErrorCode", "output": "sError", "strip": "kError"}@
      19             :   static const char sErrorString[] =
      20             :     "Ok\0"
      21             :     "OutOfMemory\0"
      22             :     "InvalidArgument\0"
      23             :     "InvalidState\0"
      24             :     "InvalidArch\0"
      25             :     "NotInitialized\0"
      26             :     "AlreadyInitialized\0"
      27             :     "FeatureNotEnabled\0"
      28             :     "TooManyHandles\0"
      29             :     "TooLarge\0"
      30             :     "NoCodeGenerated\0"
      31             :     "InvalidDirective\0"
      32             :     "InvalidLabel\0"
      33             :     "TooManyLabels\0"
      34             :     "LabelAlreadyBound\0"
      35             :     "LabelAlreadyDefined\0"
      36             :     "LabelNameTooLong\0"
      37             :     "InvalidLabelName\0"
      38             :     "InvalidParentLabel\0"
      39             :     "InvalidSection\0"
      40             :     "TooManySections\0"
      41             :     "InvalidSectionName\0"
      42             :     "TooManyRelocations\0"
      43             :     "InvalidRelocEntry\0"
      44             :     "RelocOffsetOutOfRange\0"
      45             :     "InvalidAssignment\0"
      46             :     "InvalidInstruction\0"
      47             :     "InvalidRegType\0"
      48             :     "InvalidRegGroup\0"
      49             :     "InvalidPhysId\0"
      50             :     "InvalidVirtId\0"
      51             :     "InvalidElementIndex\0"
      52             :     "InvalidPrefixCombination\0"
      53             :     "InvalidLockPrefix\0"
      54             :     "InvalidXAcquirePrefix\0"
      55             :     "InvalidXReleasePrefix\0"
      56             :     "InvalidRepPrefix\0"
      57             :     "InvalidRexPrefix\0"
      58             :     "InvalidExtraReg\0"
      59             :     "InvalidKMaskUse\0"
      60             :     "InvalidKZeroUse\0"
      61             :     "InvalidBroadcast\0"
      62             :     "InvalidEROrSAE\0"
      63             :     "InvalidAddress\0"
      64             :     "InvalidAddressIndex\0"
      65             :     "InvalidAddressScale\0"
      66             :     "InvalidAddress64Bit\0"
      67             :     "InvalidAddress64BitZeroExtension\0"
      68             :     "InvalidDisplacement\0"
      69             :     "InvalidSegment\0"
      70             :     "InvalidImmediate\0"
      71             :     "InvalidOperandSize\0"
      72             :     "AmbiguousOperandSize\0"
      73             :     "OperandSizeMismatch\0"
      74             :     "InvalidOption\0"
      75             :     "OptionAlreadyDefined\0"
      76             :     "InvalidTypeId\0"
      77             :     "InvalidUseOfGpbHi\0"
      78             :     "InvalidUseOfGpq\0"
      79             :     "InvalidUseOfF80\0"
      80             :     "NotConsecutiveRegs\0"
      81             :     "ConsecutiveRegsAllocation\0"
      82             :     "IllegalVirtReg\0"
      83             :     "TooManyVirtRegs\0"
      84             :     "NoMorePhysRegs\0"
      85             :     "OverlappedRegs\0"
      86             :     "OverlappingStackRegWithRegArg\0"
      87             :     "ExpressionLabelNotBound\0"
      88             :     "ExpressionOverflow\0"
      89             :     "FailedToOpenAnonymousMemory\0"
      90             :     "<Unknown>\0";
      91             : 
      92             :   static const uint16_t sErrorIndex[] = {
      93             :     0, 3, 15, 31, 44, 56, 71, 90, 108, 123, 132, 148, 165, 178, 192, 210, 230,
      94             :     247, 264, 283, 298, 314, 333, 352, 370, 392, 410, 429, 444, 460, 474, 488,
      95             :     508, 533, 551, 573, 595, 612, 629, 645, 661, 677, 694, 709, 724, 744, 764,
      96             :     784, 817, 837, 852, 869, 888, 909, 929, 943, 964, 978, 996, 1012, 1028, 1047,
      97             :     1073, 1088, 1104, 1119, 1134, 1164, 1188, 1207, 1235
      98             :   };
      99             :   // @EnumStringEnd@
     100             : 
     101           0 :   return sErrorString + sErrorIndex[Support::min<Error>(err, kErrorCount)];
     102             : #else
     103             :   DebugUtils::unused(err);
     104             :   static const char noMessage[] = "";
     105             :   return noMessage;
     106             : #endif
     107             : }
     108             : 
     109             : // DebugUtils - Debug Output
     110             : // =========================
     111             : 
     112           0 : ASMJIT_FAVOR_SIZE void DebugUtils::debugOutput(const char* str) noexcept {
     113             : #if defined(_WIN32)
     114             :   ::OutputDebugStringA(str);
     115             : #else
     116           0 :   ::fputs(str, stderr);
     117             : #endif
     118           0 : }
     119             : 
     120             : // DebugUtils - Fatal Errors
     121             : // =========================
     122             : 
     123           0 : ASMJIT_FAVOR_SIZE void DebugUtils::assertionFailed(const char* file, int line, const char* msg) noexcept {
     124             :   char str[1024];
     125             : 
     126             :   snprintf(str, 1024,
     127             :     "[asmjit] Assertion failed at %s (line %d):\n"
     128             :     "[asmjit] %s\n", file, line, msg);
     129             : 
     130           0 :   debugOutput(str);
     131           0 :   ::abort();
     132             : }
     133             : 
     134             : ASMJIT_END_NAMESPACE
     135             : 
     136             : #endif // __PLUMED_HAS_ASMJIT

Generated by: LCOV version 1.16