"platforms/cuda/vscode:/vscode.git/clone" did not exist on "0827ad5063bc7e59d1f2526e714f0ac6c46d2d01"
error.cpp 1.88 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// [AsmJit]
// Complete x86/x64 JIT and Remote Assembler for C++.
//
// [License]
// Zlib - See LICENSE.md file in the package.

// [Export]
#define ASMJIT_EXPORTS

// [Dependencies - AsmJit]
#include "../base/error.h"
#include "../base/intutil.h"

// [Api-Begin]
#include "../apibegin.h"

namespace asmjit {

// ============================================================================
// [asmjit::ErrorHandler - Construction / Destruction]
// ============================================================================

ErrorHandler::ErrorHandler() {}
ErrorHandler::~ErrorHandler() {}

// ============================================================================
// [asmjit::ErrorHandler - Interface]
// ============================================================================

ErrorHandler* ErrorHandler::addRef() const {
  return const_cast<ErrorHandler*>(this);
}

void ErrorHandler::release() {}

// ============================================================================
// [asmjit::ErrorUtil - AsString]
// ============================================================================

#if !defined(ASMJIT_DISABLE_NAMES)
static const char errorMessages[] = {
  "Ok\0"
  "No heap memory\0"
  "No virtual memory\0"
  "Invalid argument\0"
  "Invalid state\0"
  "No code generated\0"
  "Code too large\0"
  "Label already bound\0"
  "Unknown instruction\0"
  "Illegal instruction\0"
  "Illegal addressing\0"
  "Illegal displacement\0"
  "Overlapped arguments\0"
  "Unknown error\0"
};

static const char* findPackedString(const char* p, uint32_t id, uint32_t maxId) {
  uint32_t i = 0;

  if (id > maxId)
    id = maxId;

  while (i < id) {
    while (p[0])
      p++;
67

68
    p++;
69
    i++;
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  }

  return p;
}

const char* ErrorUtil::asString(Error e) {
  return findPackedString(errorMessages, e, kErrorCount);
}
#endif // ASMJIT_DISABLE_NAMES

} // asmjit namespace

// [Api-End]
#include "../apiend.h"