diff --git a/llvm/tools/llvm-exegesis/lib/PerfHelper.cpp b/llvm/tools/llvm-exegesis/lib/PerfHelper.cpp --- a/llvm/tools/llvm-exegesis/lib/PerfHelper.cpp +++ b/llvm/tools/llvm-exegesis/lib/PerfHelper.cpp @@ -12,9 +12,9 @@ #include "llvm/Support/Error.h" #include "llvm/Support/raw_ostream.h" #ifdef HAVE_LIBPFM -#include "perfmon/perf_event.h" -#include "perfmon/pfmlib.h" -#include "perfmon/pfmlib_perf_event.h" +#include +#include +#include #endif #include diff --git a/llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp b/llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp --- a/llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp +++ b/llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp @@ -8,19 +8,18 @@ #include "X86Counter.h" -#if defined(HAVE_LIBPFM) && defined(LIBPFM_HAS_FIELD_CYCLES) +#if defined(__linux__) && defined(HAVE_LIBPFM) && \ + defined(LIBPFM_HAS_FIELD_CYCLES) // FIXME: Use appropriate wrappers for poll.h and mman.h // to support Windows and remove this linux-only guard. -#ifdef __linux__ + #include "llvm/Support/Endian.h" #include "llvm/Support/Errc.h" -#ifdef HAVE_LIBPFM -#include "perfmon/perf_event.h" -#include "perfmon/pfmlib.h" -#include "perfmon/pfmlib_perf_event.h" -#endif // HAVE_LIBPFM +#include +#include +#include #include #include @@ -258,5 +257,5 @@ } // namespace exegesis } // namespace llvm -#endif // defined(HAVE_LIBPFM) && defined(LIBPFM_HAS_FIELD_CYCLES) -#endif // __linux__ +#endif // defined(__linux__) && defined(HAVE_LIBPFM) && + // defined(LIBPFM_HAS_FIELD_CYCLES)