[llvm] [llvm] Fix missing includes (PR #128000)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 04:26:55 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-pgo

@llvm/pr-subscribers-llvm-support

Author: Tobias Fuchs (devtbi)

<details>
<summary>Changes</summary>

Compilation with `LLVM_ENABLE_MODULES:BOOL=ON` fails due to missing includes. This patch adds these includes (+missing tuple include in thread.h), fixing the module build for me.

---
Full diff: https://github.com/llvm/llvm-project/pull/128000.diff


3 Files Affected:

- (modified) llvm/include/llvm/CodeGen/ByteProvider.h (+1) 
- (modified) llvm/include/llvm/ProfileData/Coverage/MCDCTypes.h (+1) 
- (modified) llvm/include/llvm/Support/thread.h (+4-2) 


``````````diff
diff --git a/llvm/include/llvm/CodeGen/ByteProvider.h b/llvm/include/llvm/CodeGen/ByteProvider.h
index 3187b4e68c56f..b97ff5c1aa039 100644
--- a/llvm/include/llvm/CodeGen/ByteProvider.h
+++ b/llvm/include/llvm/CodeGen/ByteProvider.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_CODEGEN_BYTEPROVIDER_H
 #define LLVM_CODEGEN_BYTEPROVIDER_H
 
+#include "llvm/Support/DataTypes.h"
 #include <optional>
 #include <type_traits>
 
diff --git a/llvm/include/llvm/ProfileData/Coverage/MCDCTypes.h b/llvm/include/llvm/ProfileData/Coverage/MCDCTypes.h
index 191e4ead95ea2..fea1e0bc04d26 100644
--- a/llvm/include/llvm/ProfileData/Coverage/MCDCTypes.h
+++ b/llvm/include/llvm/ProfileData/Coverage/MCDCTypes.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_PROFILEDATA_COVERAGE_MCDCTYPES_H
 #define LLVM_PROFILEDATA_COVERAGE_MCDCTYPES_H
 
+#include "llvm/Support/DataTypes.h"
 #include <array>
 #include <cassert>
 #include <type_traits>
diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h
index 69c06c050aac5..e3005fdb63175 100644
--- a/llvm/include/llvm/Support/thread.h
+++ b/llvm/include/llvm/Support/thread.h
@@ -18,6 +18,8 @@
 
 #include "llvm/Config/llvm-config.h"
 #include <optional>
+#include <tuple>
+#include <utility>
 
 #ifdef _WIN32
 typedef unsigned long DWORD;
@@ -202,8 +204,8 @@ class thread {
 };
 
 namespace this_thread {
-  inline thread::id get_id() { return std::this_thread::get_id(); }
-}
+inline thread::id get_id() { return std::this_thread::get_id(); }
+} // namespace this_thread
 
 #endif // LLVM_ON_UNIX || _WIN32
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/128000


More information about the llvm-commits mailing list