-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][Modules] Fixing Build Breaks When -DLLVM_ENABLE_MODULES=ON #119473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-backend-nvptx Author: Qiongsi Wu (qiongsiwu) ChangesA few recent changes are causing build breaks when This PR makes the required updates so that clang/llvm builds when Full diff: https://github.com/llvm/llvm-project/pull/119473.diff 9 Files Affected:
diff --git a/clang/include/clang/Support/Compiler.h b/clang/include/clang/Support/Compiler.h
index 13582b899dc2a6..0cba1ad7331682 100644
--- a/clang/include/clang/Support/Compiler.h
+++ b/clang/include/clang/Support/Compiler.h
@@ -14,8 +14,6 @@
#ifndef CLANG_SUPPORT_COMPILER_H
#define CLANG_SUPPORT_COMPILER_H
-#include "llvm/Support/Compiler.h"
-
/// CLANG_ABI is the main export/visibility macro to mark something as
/// explicitly exported when clang is built as a shared library with everything
/// else that is unannotated having hidden visibility.
diff --git a/clang/include/module.modulemap b/clang/include/module.modulemap
index b399f0beee59a1..e9218c715147b0 100644
--- a/clang/include/module.modulemap
+++ b/clang/include/module.modulemap
@@ -115,7 +115,7 @@ module Clang_Diagnostics {
module Driver { header "clang/Driver/DriverDiagnostic.h" export * }
module Frontend { header "clang/Frontend/FrontendDiagnostic.h" export * }
module Lex { header "clang/Lex/LexDiagnostic.h" export * }
- module Parse { header "clang/Parse/ParseDiagnostic.h" export * }
+ module Parse { header "clang/Basic/DiagnosticParse.h" export * }
module Serialization { header "clang/Serialization/SerializationDiagnostic.h" export * }
module Refactoring { header "clang/Tooling/Refactoring/RefactoringDiagnostic.h" export * }
}
@@ -186,6 +186,9 @@ module Clang_StaticAnalyzer_Frontend {
module Clang_Testing {
requires cplusplus
umbrella "clang/Testing"
+
+ textual header "clang/Testing/TestLanguage.def"
+
module * { export * }
}
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
index 3c936b93865045..bd25f6c30ebf1f 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H
#define LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/IR/NVVMIntrinsicFlags.h b/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
index 43dde42bbbd620..dfb6e857b3a6ad 100644
--- a/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
+++ b/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
@@ -15,6 +15,8 @@
#ifndef LLVM_IR_NVVMINTRINSICFLAGS_H
#define LLVM_IR_NVVMINTRINSICFLAGS_H
+#include <stdint.h>
+
namespace llvm {
namespace nvvm {
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index c02a3cc14dc7de..a587f2a8542b2e 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -15,6 +15,7 @@
#include "llvm/Support/DataTypes.h"
#include <system_error>
+#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 1311329821828f..11836e87d1b208 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -16,6 +16,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Bitset.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/VersionTuple.h"
diff --git a/llvm/include/module.modulemap b/llvm/include/module.modulemap
index b00da6d7cd28c7..ac7bd257cbb422 100644
--- a/llvm/include/module.modulemap
+++ b/llvm/include/module.modulemap
@@ -346,6 +346,7 @@ extern module LLVM_Extern_Utils_DataTypes "module.extern.modulemap"
// TargetParser module before building the TargetParser module itself.
module TargetParserGen {
module AArch64TargetParserDef {
+ textual header "llvm/TargetParser/AArch64CPUFeatures.inc"
header "llvm/TargetParser/AArch64TargetParser.h"
extern module LLVM_Extern_TargetParser_Gen "module.extern.modulemap"
export *
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
index f2daa294eec072..0692f4351ad67f 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
@@ -2,6 +2,7 @@ set(LLVM_LINK_COMPONENTS
OrcShared
OrcTargetProcess
Support
+ Core
)
add_llvm_utility(llvm-jitlink-executor
diff --git a/llvm/unittests/tools/llvm-profgen/CMakeLists.txt b/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
index 5a658cf7084678..51de95311a6c91 100644
--- a/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
@@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS
Support
+ Core
)
add_llvm_unittest(LLVMProfgenTests
|
@llvm/pr-subscribers-clang Author: Qiongsi Wu (qiongsiwu) ChangesA few recent changes are causing build breaks when This PR makes the required updates so that clang/llvm builds when Full diff: https://github.com/llvm/llvm-project/pull/119473.diff 9 Files Affected:
diff --git a/clang/include/clang/Support/Compiler.h b/clang/include/clang/Support/Compiler.h
index 13582b899dc2a6..0cba1ad7331682 100644
--- a/clang/include/clang/Support/Compiler.h
+++ b/clang/include/clang/Support/Compiler.h
@@ -14,8 +14,6 @@
#ifndef CLANG_SUPPORT_COMPILER_H
#define CLANG_SUPPORT_COMPILER_H
-#include "llvm/Support/Compiler.h"
-
/// CLANG_ABI is the main export/visibility macro to mark something as
/// explicitly exported when clang is built as a shared library with everything
/// else that is unannotated having hidden visibility.
diff --git a/clang/include/module.modulemap b/clang/include/module.modulemap
index b399f0beee59a1..e9218c715147b0 100644
--- a/clang/include/module.modulemap
+++ b/clang/include/module.modulemap
@@ -115,7 +115,7 @@ module Clang_Diagnostics {
module Driver { header "clang/Driver/DriverDiagnostic.h" export * }
module Frontend { header "clang/Frontend/FrontendDiagnostic.h" export * }
module Lex { header "clang/Lex/LexDiagnostic.h" export * }
- module Parse { header "clang/Parse/ParseDiagnostic.h" export * }
+ module Parse { header "clang/Basic/DiagnosticParse.h" export * }
module Serialization { header "clang/Serialization/SerializationDiagnostic.h" export * }
module Refactoring { header "clang/Tooling/Refactoring/RefactoringDiagnostic.h" export * }
}
@@ -186,6 +186,9 @@ module Clang_StaticAnalyzer_Frontend {
module Clang_Testing {
requires cplusplus
umbrella "clang/Testing"
+
+ textual header "clang/Testing/TestLanguage.def"
+
module * { export * }
}
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
index 3c936b93865045..bd25f6c30ebf1f 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H
#define LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/IR/NVVMIntrinsicFlags.h b/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
index 43dde42bbbd620..dfb6e857b3a6ad 100644
--- a/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
+++ b/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
@@ -15,6 +15,8 @@
#ifndef LLVM_IR_NVVMINTRINSICFLAGS_H
#define LLVM_IR_NVVMINTRINSICFLAGS_H
+#include <stdint.h>
+
namespace llvm {
namespace nvvm {
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index c02a3cc14dc7de..a587f2a8542b2e 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -15,6 +15,7 @@
#include "llvm/Support/DataTypes.h"
#include <system_error>
+#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 1311329821828f..11836e87d1b208 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -16,6 +16,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Bitset.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/VersionTuple.h"
diff --git a/llvm/include/module.modulemap b/llvm/include/module.modulemap
index b00da6d7cd28c7..ac7bd257cbb422 100644
--- a/llvm/include/module.modulemap
+++ b/llvm/include/module.modulemap
@@ -346,6 +346,7 @@ extern module LLVM_Extern_Utils_DataTypes "module.extern.modulemap"
// TargetParser module before building the TargetParser module itself.
module TargetParserGen {
module AArch64TargetParserDef {
+ textual header "llvm/TargetParser/AArch64CPUFeatures.inc"
header "llvm/TargetParser/AArch64TargetParser.h"
extern module LLVM_Extern_TargetParser_Gen "module.extern.modulemap"
export *
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
index f2daa294eec072..0692f4351ad67f 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
@@ -2,6 +2,7 @@ set(LLVM_LINK_COMPONENTS
OrcShared
OrcTargetProcess
Support
+ Core
)
add_llvm_utility(llvm-jitlink-executor
diff --git a/llvm/unittests/tools/llvm-profgen/CMakeLists.txt b/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
index 5a658cf7084678..51de95311a6c91 100644
--- a/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
@@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS
Support
+ Core
)
add_llvm_unittest(LLVMProfgenTests
|
@llvm/pr-subscribers-llvm-support Author: Qiongsi Wu (qiongsiwu) ChangesA few recent changes are causing build breaks when This PR makes the required updates so that clang/llvm builds when Full diff: https://github.com/llvm/llvm-project/pull/119473.diff 9 Files Affected:
diff --git a/clang/include/clang/Support/Compiler.h b/clang/include/clang/Support/Compiler.h
index 13582b899dc2a6..0cba1ad7331682 100644
--- a/clang/include/clang/Support/Compiler.h
+++ b/clang/include/clang/Support/Compiler.h
@@ -14,8 +14,6 @@
#ifndef CLANG_SUPPORT_COMPILER_H
#define CLANG_SUPPORT_COMPILER_H
-#include "llvm/Support/Compiler.h"
-
/// CLANG_ABI is the main export/visibility macro to mark something as
/// explicitly exported when clang is built as a shared library with everything
/// else that is unannotated having hidden visibility.
diff --git a/clang/include/module.modulemap b/clang/include/module.modulemap
index b399f0beee59a1..e9218c715147b0 100644
--- a/clang/include/module.modulemap
+++ b/clang/include/module.modulemap
@@ -115,7 +115,7 @@ module Clang_Diagnostics {
module Driver { header "clang/Driver/DriverDiagnostic.h" export * }
module Frontend { header "clang/Frontend/FrontendDiagnostic.h" export * }
module Lex { header "clang/Lex/LexDiagnostic.h" export * }
- module Parse { header "clang/Parse/ParseDiagnostic.h" export * }
+ module Parse { header "clang/Basic/DiagnosticParse.h" export * }
module Serialization { header "clang/Serialization/SerializationDiagnostic.h" export * }
module Refactoring { header "clang/Tooling/Refactoring/RefactoringDiagnostic.h" export * }
}
@@ -186,6 +186,9 @@ module Clang_StaticAnalyzer_Frontend {
module Clang_Testing {
requires cplusplus
umbrella "clang/Testing"
+
+ textual header "clang/Testing/TestLanguage.def"
+
module * { export * }
}
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
index 3c936b93865045..bd25f6c30ebf1f 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
@@ -9,6 +9,7 @@
#ifndef LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H
#define LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/IR/NVVMIntrinsicFlags.h b/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
index 43dde42bbbd620..dfb6e857b3a6ad 100644
--- a/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
+++ b/llvm/include/llvm/IR/NVVMIntrinsicFlags.h
@@ -15,6 +15,8 @@
#ifndef LLVM_IR_NVVMINTRINSICFLAGS_H
#define LLVM_IR_NVVMINTRINSICFLAGS_H
+#include <stdint.h>
+
namespace llvm {
namespace nvvm {
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index c02a3cc14dc7de..a587f2a8542b2e 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -15,6 +15,7 @@
#include "llvm/Support/DataTypes.h"
#include <system_error>
+#include <utility>
namespace llvm {
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 1311329821828f..11836e87d1b208 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -16,6 +16,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Bitset.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/VersionTuple.h"
diff --git a/llvm/include/module.modulemap b/llvm/include/module.modulemap
index b00da6d7cd28c7..ac7bd257cbb422 100644
--- a/llvm/include/module.modulemap
+++ b/llvm/include/module.modulemap
@@ -346,6 +346,7 @@ extern module LLVM_Extern_Utils_DataTypes "module.extern.modulemap"
// TargetParser module before building the TargetParser module itself.
module TargetParserGen {
module AArch64TargetParserDef {
+ textual header "llvm/TargetParser/AArch64CPUFeatures.inc"
header "llvm/TargetParser/AArch64TargetParser.h"
extern module LLVM_Extern_TargetParser_Gen "module.extern.modulemap"
export *
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
index f2daa294eec072..0692f4351ad67f 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
@@ -2,6 +2,7 @@ set(LLVM_LINK_COMPONENTS
OrcShared
OrcTargetProcess
Support
+ Core
)
add_llvm_utility(llvm-jitlink-executor
diff --git a/llvm/unittests/tools/llvm-profgen/CMakeLists.txt b/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
index 5a658cf7084678..51de95311a6c91 100644
--- a/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-profgen/CMakeLists.txt
@@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS
Support
+ Core
)
add_llvm_unittest(LLVMProfgenTests
|
…ofgen when building with modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add the <stdint.h> header include back into NVVMIntrinsicUtils.h after rebasing the commit which renamed it to a point after the original NVVMIntrinsicFlags.h version was edited to include <stdint> This extra include was originally added by: f33e236 [clang][Modules] Fixing Build Breaks When -DLLVM_ENABLE_MODULES=ON (llvm#119473)
A few recent changes are causing build breaks when
-DLLVM_ENABLE_MODULES=ON
(such as 834dfd2 and 7dfdca1).This PR makes the required updates so that clang/llvm builds when
-DLLVM_ENABLE_MODULES=ON
.