[PATCH] D105861: [llvm-exegesis] Fix missing-headers build errors.

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 10:20:40 PDT 2021


oontvoo updated this revision to Diff 359040.
oontvoo added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105861/new/

https://reviews.llvm.org/D105861

Files:
  llvm/tools/llvm-exegesis/lib/PerfHelper.cpp
  llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp


Index: llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp
===================================================================
--- llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp
+++ 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 <perfmon/perf_event.h>
+#include <perfmon/pfmlib.h>
+#include <perfmon/pfmlib_perf_event.h>
 
 #include <atomic>
 #include <chrono>
@@ -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)
Index: llvm/tools/llvm-exegesis/lib/PerfHelper.cpp
===================================================================
--- llvm/tools/llvm-exegesis/lib/PerfHelper.cpp
+++ 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 <perfmon/perf_event.h>
+#include <perfmon/pfmlib.h>
+#include <perfmon/pfmlib_perf_event.h>
 #endif
 
 #include <cassert>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105861.359040.patch
Type: text/x-patch
Size: 1766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210715/b178d607/attachment.bin>


More information about the llvm-commits mailing list