Skip to content

Commit

Permalink
[llvm-exegesis] Fix missing-headers build errors.
Browse files Browse the repository at this point in the history
Details:

Switch all #includes to use <> because that is consistent with what happens in the cmake checks.
Otherwise, we could be in the situation where cmake checks see that headers exist at <perfmon/...>
but in  llvm-exegesis code, we use "perfmon/...", which may not exist.

Related PR/revisions: D84076, PR51017+D105615

    Differential Revision: https://reviews.llvm.org/D105861
  • Loading branch information
oontvoo committed Jul 15, 2021
1 parent 99cb250 commit a35480f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions llvm/tools/llvm-exegesis/lib/PerfHelper.cpp
Expand Up @@ -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>
Expand Down
17 changes: 8 additions & 9 deletions llvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp
Expand Up @@ -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>
Expand Down Expand Up @@ -258,5 +257,5 @@ X86LbrCounter::doReadCounter(const void *From, const void *To) const {
} // 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)

0 comments on commit a35480f

Please sign in to comment.