1
- // ===- xray_interface.h -------------------------------------------------- -===//
1
+ // ===- xray_interface.h -----------------------------------------*- C++ -* -===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
14
14
#ifndef XRAY_XRAY_INTERFACE_H
15
15
#define XRAY_XRAY_INTERFACE_H
16
16
17
- #ifdef __cplusplus
18
17
#include < cstddef>
19
18
#include < cstdint>
20
- #else
21
- #include < stddef.h>
22
- #include < stdint.h>
23
- #endif
24
19
25
- #ifdef __cplusplus
26
20
extern " C" {
27
- #endif
28
21
29
22
// / Synchronize this with AsmPrinter::SledKind in LLVM.
30
23
enum XRayEntryType {
@@ -56,7 +49,7 @@ enum XRayEntryType {
56
49
// / achieved by marking them all with: __attribute__((xray_never_instrument))
57
50
// /
58
51
// / Returns 1 on success, 0 on error.
59
- extern int __xray_set_handler (void (*entry)(int32_t , enum XRayEntryType));
52
+ extern int __xray_set_handler (void (*entry)(int32_t , XRayEntryType));
60
53
61
54
// / This removes whatever the currently provided handler is. Returns 1 on
62
55
// / success, 0 on error.
@@ -67,15 +60,15 @@ extern int __xray_remove_handler();
67
60
// / start logging their subsequent affected function calls (if patched).
68
61
// /
69
62
// / Returns 1 on success, 0 on error.
70
- extern int __xray_set_handler_arg1 (void (*entry)(int32_t , enum XRayEntryType,
63
+ extern int __xray_set_handler_arg1 (void (*entry)(int32_t , XRayEntryType,
71
64
uint64_t ));
72
65
73
66
// / Disables the XRay handler used to log first arguments of function calls.
74
67
// / Returns 1 on success, 0 on error.
75
68
extern int __xray_remove_handler_arg1 ();
76
69
77
70
// / Provide a function to invoke when XRay encounters a custom event.
78
- extern int __xray_set_customevent_handler (void (*entry)(void *, size_t ));
71
+ extern int __xray_set_customevent_handler (void (*entry)(void *, std:: size_t ));
79
72
80
73
// / This removes whatever the currently provided custom event handler is.
81
74
// / Returns 1 on success, 0 on error.
@@ -102,39 +95,39 @@ enum XRayPatchingStatus {
102
95
103
96
// / This tells XRay to patch the instrumentation points in all currently loaded
104
97
// / objects. See XRayPatchingStatus for possible result values.
105
- extern enum XRayPatchingStatus __xray_patch ();
98
+ extern XRayPatchingStatus __xray_patch ();
106
99
107
100
// / This tells XRay to patch the instrumentation points in the given object.
108
101
// / See XRayPatchingStatus for possible result values.
109
- extern enum XRayPatchingStatus __xray_patch_object (int32_t ObjId);
102
+ extern XRayPatchingStatus __xray_patch_object (int32_t ObjId);
110
103
111
104
// / Reverses the effect of __xray_patch(). See XRayPatchingStatus for possible
112
105
// / result values.
113
- extern enum XRayPatchingStatus __xray_unpatch ();
106
+ extern XRayPatchingStatus __xray_unpatch ();
114
107
115
108
// / Reverses the effect of __xray_patch_object. See XRayPatchingStatus for
116
109
// / possible result values.
117
- extern enum XRayPatchingStatus __xray_unpatch_object (int32_t ObjId);
110
+ extern XRayPatchingStatus __xray_unpatch_object (int32_t ObjId);
118
111
119
112
// / This unpacks the given (packed) function id and patches
120
113
// / the corresponding function. See XRayPatchingStatus for possible
121
114
// / result values.
122
- extern enum XRayPatchingStatus __xray_patch_function (int32_t FuncId);
115
+ extern XRayPatchingStatus __xray_patch_function (int32_t FuncId);
123
116
124
117
// / This patches a specific function in the given object. See XRayPatchingStatus
125
118
// / for possible result values.
126
- extern enum XRayPatchingStatus __xray_patch_function_in_object (int32_t FuncId,
127
- int32_t ObjId);
119
+ extern XRayPatchingStatus __xray_patch_function_in_object (int32_t FuncId,
120
+ int32_t ObjId);
128
121
129
122
// / This unpacks the given (packed) function id and unpatches
130
123
// / the corresponding function. See XRayPatchingStatus for possible
131
124
// / result values.
132
- extern enum XRayPatchingStatus __xray_unpatch_function (int32_t FuncId);
125
+ extern XRayPatchingStatus __xray_unpatch_function (int32_t FuncId);
133
126
134
127
// / This unpatches a specific function in the given object.
135
128
// / See XRayPatchingStatus for possible result values.
136
- extern enum XRayPatchingStatus __xray_unpatch_function_in_object (int32_t FuncId,
137
- int32_t ObjId);
129
+ extern XRayPatchingStatus __xray_unpatch_function_in_object (int32_t FuncId,
130
+ int32_t ObjId);
138
131
139
132
// / This function unpacks the given (packed) function id and returns the address
140
133
// / of the corresponding function. We return 0 if we encounter any error, even
@@ -180,8 +173,6 @@ extern int32_t __xray_pack_id(int32_t FuncId, int32_t ObjId);
180
173
// / Calling __xray_init() more than once is safe across multiple threads.
181
174
extern void __xray_init ();
182
175
183
- #ifdef __cplusplus
184
176
} // end extern "C"
185
- #endif
186
177
187
178
#endif // XRAY_XRAY_INTERFACE_H
0 commit comments