LLVM: include/llvm/Support/ErrorHandling.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_SUPPORT_ERRORHANDLING_H

15#define LLVM_SUPPORT_ERRORHANDLING_H

16

18

19namespace llvm {

22

23

25 bool gen_crash_diag);

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

44 void *user_data = nullptr);

45

46

48

49

50

51

54 void *user_data = nullptr) {

56 }

57

59};

60

61

62

64 bool gen_crash_diag = true);

66 bool gen_crash_diag = true);

68 bool gen_crash_diag = true);

69

70

71

72

73

74

75

76

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

116 void *user_data = nullptr);

117

118

120

122

123

124

125

126

127

128

129

130

131

132

133

134

136 bool GenCrashDiag = true);

137

138

139

140

142 const char *file = nullptr,

143 unsigned line = 0);

144}

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163#ifndef NDEBUG

164#define llvm_unreachable(msg) \

165 ::llvm::llvm_unreachable_internal(msg, __FILE__, __LINE__)

166#elif !defined(LLVM_BUILTIN_UNREACHABLE)

167#define llvm_unreachable(msg) ::llvm::llvm_unreachable_internal()

168#elif LLVM_UNREACHABLE_OPTIMIZE

169#define llvm_unreachable(msg) LLVM_BUILTIN_UNREACHABLE

170#else

171#define llvm_unreachable(msg) \

172 do { \

173 LLVM_BUILTIN_TRAP; \

174 LLVM_BUILTIN_UNREACHABLE; \

175 } while (false)

176#endif

177

178#endif

dot regions Print regions of function to dot file(with no function bodies)"

StringRef - Represent a constant reference to a string, i.e.

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI void install_fatal_error_handler(fatal_error_handler_t handler, void *user_data=nullptr)

install_fatal_error_handler - Installs a new error handler to be used whenever a serious (non-recover...

LLVM_ABI void install_bad_alloc_error_handler(fatal_error_handler_t handler, void *user_data=nullptr)

Installs a new bad alloc error handler that should be used whenever a bad alloc error,...

LLVM_ABI void remove_bad_alloc_error_handler()

Restores default bad alloc error handling behavior.

LLVM_ABI void reportFatalInternalError(Error Err)

Report a fatal error that indicates a bug in LLVM.

LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)

LLVM_ABI void install_out_of_memory_new_handler()

LLVM_ABI void llvm_unreachable_internal(const char *msg=nullptr, const char *file=nullptr, unsigned line=0)

This function calls abort(), and prints the optional message to stderr.

void(*)(void *user_data, const char *reason, bool gen_crash_diag) fatal_error_handler_t

An error handler callback.

Definition ErrorHandling.h:24

LLVM_ABI void remove_fatal_error_handler()

Restores default error handling behaviour.

LLVM_ABI void report_bad_alloc_error(const char *Reason, bool GenCrashDiag=true)

Reports a bad alloc error, calling any user defined bad alloc error handler.

LLVM_ABI void reportFatalUsageError(Error Err)

Report a fatal error that does not indicate a bug in LLVM.

~ScopedFatalErrorHandler()

Definition ErrorHandling.h:58

ScopedFatalErrorHandler(fatal_error_handler_t handler, void *user_data=nullptr)

Definition ErrorHandling.h:53