[llvm] ae4846d - [llvm-exegesis] Use correct pid_t definition in SubprocessMemory.h

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 13:03:46 PDT 2023


Author: Aiden Grossman
Date: 2023-06-27T20:03:40Z
New Revision: ae4846d8a10c9ca566983fce49e1825a5fac88b6

URL: https://github.com/llvm/llvm-project/commit/ae4846d8a10c9ca566983fce49e1825a5fac88b6
DIFF: https://github.com/llvm/llvm-project/commit/ae4846d8a10c9ca566983fce49e1825a5fac88b6.diff

LOG: [llvm-exegesis] Use correct pid_t definition in SubprocessMemory.h

Due to failures in MinGW builds I adjusted the preprocessor directives
to be more specific about when to include but kept the old definition in
files that were committed more recently on accident. This patch changes
those definitions to match the fixed ones.

Also fix a typo leftover from the original change in PerfHelper.h.

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/PerfHelper.h
    llvm/tools/llvm-exegesis/lib/SubprocessMemory.h

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/PerfHelper.h b/llvm/tools/llvm-exegesis/lib/PerfHelper.h
index 0796c264b6229..a50974f0a67be 100644
--- a/llvm/tools/llvm-exegesis/lib/PerfHelper.h
+++ b/llvm/tools/llvm-exegesis/lib/PerfHelper.h
@@ -27,7 +27,7 @@
 typedef int pid_t;
 #else
 #include <sys/types.h>
-#endif // HAVE_LIBPFM
+#endif // _MSC_VER
 
 struct perf_event_attr;
 

diff  --git a/llvm/tools/llvm-exegesis/lib/SubprocessMemory.h b/llvm/tools/llvm-exegesis/lib/SubprocessMemory.h
index 9b55bc40272b3..e20b50cdc8118 100644
--- a/llvm/tools/llvm-exegesis/lib/SubprocessMemory.h
+++ b/llvm/tools/llvm-exegesis/lib/SubprocessMemory.h
@@ -20,9 +20,12 @@
 #include <unordered_map>
 #include <vector>
 
-#ifndef __linux__
+#ifdef _MSC_VER
 typedef int pid_t;
-#endif // __linux__
+#else
+#include <sys/types.h>
+#endif // _MSC_VER
+
 
 namespace llvm {
 namespace exegesis {


        


More information about the llvm-commits mailing list