clang-c.h 917 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef PERF_UTIL_CLANG_C_H
  2. #define PERF_UTIL_CLANG_C_H
  3. #include <stddef.h> /* for size_t */
  4. #include <util-cxx.h> /* for __maybe_unused */
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #ifdef HAVE_LIBCLANGLLVM_SUPPORT
  9. extern void perf_clang__init(void);
  10. extern void perf_clang__cleanup(void);
  11. extern int test__clang_to_IR(void);
  12. extern int test__clang_to_obj(void);
  13. extern int perf_clang__compile_bpf(const char *filename,
  14. void **p_obj_buf,
  15. size_t *p_obj_buf_sz);
  16. #else
  17. static inline void perf_clang__init(void) { }
  18. static inline void perf_clang__cleanup(void) { }
  19. static inline int test__clang_to_IR(void) { return -1; }
  20. static inline int test__clang_to_obj(void) { return -1;}
  21. static inline int
  22. perf_clang__compile_bpf(const char *filename __maybe_unused,
  23. void **p_obj_buf __maybe_unused,
  24. size_t *p_obj_buf_sz __maybe_unused)
  25. {
  26. return -ENOTSUP;
  27. }
  28. #endif
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif