Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / tools / perf / util / c++ / clang-c.h
blob2df8a45bd0888f17a9a22d0d4002ebce83420d1e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef PERF_UTIL_CLANG_C_H
3 #define PERF_UTIL_CLANG_C_H
5 #include <stddef.h> /* for size_t */
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 #ifdef HAVE_LIBCLANGLLVM_SUPPORT
12 extern void perf_clang__init(void);
13 extern void perf_clang__cleanup(void);
15 extern int test__clang_to_IR(void);
16 extern int test__clang_to_obj(void);
18 extern int perf_clang__compile_bpf(const char *filename,
19 void **p_obj_buf,
20 size_t *p_obj_buf_sz);
21 #else
23 #include <errno.h>
24 #include <linux/compiler.h> /* for __maybe_unused */
26 static inline void perf_clang__init(void) { }
27 static inline void perf_clang__cleanup(void) { }
29 static inline int test__clang_to_IR(void) { return -1; }
30 static inline int test__clang_to_obj(void) { return -1;}
32 static inline int
33 perf_clang__compile_bpf(const char *filename __maybe_unused,
34 void **p_obj_buf __maybe_unused,
35 size_t *p_obj_buf_sz __maybe_unused)
37 return -ENOTSUP;
40 #endif
42 #ifdef __cplusplus
44 #endif
45 #endif