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

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


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

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.

>From b1835c1922c65cae3f930b69959588518ee498e8 Mon Sep 17 00:00:00 2001
From: Tobias Fuchs <fuchs at roofline.ai>
Date: Thu, 20 Feb 2025 12:26:51 +0100
Subject: [PATCH] [llvm] Fix missing includes

---
 llvm/include/llvm/CodeGen/ByteProvider.h           | 1 +
 llvm/include/llvm/ProfileData/Coverage/MCDCTypes.h | 1 +
 llvm/include/llvm/Support/thread.h                 | 6 ++++--
 3 files changed, 6 insertions(+), 2 deletions(-)

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
 



More information about the llvm-commits mailing list