-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[clang][builtins] Add stdckdint.h to the modulemap. #166230
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
All builtin Clang headers need to be covered by the modulemap. This fixes llvm#166173
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-x86 Author: Michael Spencer (Bigcheese) ChangesAll builtin Clang headers need to be covered by the modulemap. This fixes #166173 Full diff: https://github.com/llvm/llvm-project/pull/166230.diff 4 Files Affected:
diff --git a/clang/lib/Headers/module.modulemap b/clang/lib/Headers/module.modulemap
index 2e4d533356569..c13dd3fd48ac8 100644
--- a/clang/lib/Headers/module.modulemap
+++ b/clang/lib/Headers/module.modulemap
@@ -253,6 +253,11 @@ module _Builtin_stdbool [system] {
export *
}
+module _Builtin_stdckdint [system] {
+ header "stdckdint.h"
+ export *
+}
+
module _Builtin_stdcountof [system] {
header "stdcountof.h"
export *
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 637a08fe4dcdb..b8202ea11be36 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -258,6 +258,7 @@ static bool isBuiltinHeaderName(StringRef FileName) {
.Case("stdarg.h", true)
.Case("stdatomic.h", true)
.Case("stdbool.h", true)
+ .Case("stdckdint.h", true)
.Case("stdcountof.h", true)
.Case("stddef.h", true)
.Case("stdint.h", true)
diff --git a/clang/test/Modules/Inputs/builtin-headers/system-modules.modulemap b/clang/test/Modules/Inputs/builtin-headers/system-modules.modulemap
index 186965177caaf..8ab6ae4779ea9 100644
--- a/clang/test/Modules/Inputs/builtin-headers/system-modules.modulemap
+++ b/clang/test/Modules/Inputs/builtin-headers/system-modules.modulemap
@@ -49,6 +49,11 @@ module cstd [system] [no_undeclared_includes] {
export *
}
+ module stdckdint {
+ header "stdckdint.h"
+ export *
+ }
+
module stdcountof {
header "stdcountof.h"
export *
diff --git a/clang/test/Modules/builtin-headers.mm b/clang/test/Modules/builtin-headers.mm
index ad2d66ae38dfd..6cd366228172e 100644
--- a/clang/test/Modules/builtin-headers.mm
+++ b/clang/test/Modules/builtin-headers.mm
@@ -17,6 +17,7 @@
@import _Builtin_stdarg;
@import _Builtin_stdatomic;
@import _Builtin_stdbool;
+@import _Builtin_stdckdint;
@import _Builtin_stdcountof;
@import _Builtin_stddef;
@import _Builtin_stdint;
|
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions cpp -- clang/lib/Lex/ModuleMap.cpp --diff_from_common_commit
View the diff from clang-format here.diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index b8202ea11..a62183c58 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -251,20 +251,20 @@ OptionalFileEntryRef ModuleMap::findHeader(
/// headers.
static bool isBuiltinHeaderName(StringRef FileName) {
return llvm::StringSwitch<bool>(FileName)
- .Case("float.h", true)
- .Case("iso646.h", true)
- .Case("limits.h", true)
- .Case("stdalign.h", true)
- .Case("stdarg.h", true)
- .Case("stdatomic.h", true)
- .Case("stdbool.h", true)
- .Case("stdckdint.h", true)
- .Case("stdcountof.h", true)
- .Case("stddef.h", true)
- .Case("stdint.h", true)
- .Case("tgmath.h", true)
- .Case("unwind.h", true)
- .Default(false);
+ .Case("float.h", true)
+ .Case("iso646.h", true)
+ .Case("limits.h", true)
+ .Case("stdalign.h", true)
+ .Case("stdarg.h", true)
+ .Case("stdatomic.h", true)
+ .Case("stdbool.h", true)
+ .Case("stdckdint.h", true)
+ .Case("stdcountof.h", true)
+ .Case("stddef.h", true)
+ .Case("stdint.h", true)
+ .Case("tgmath.h", true)
+ .Case("unwind.h", true)
+ .Default(false);
}
/// Determine whether the given module name is the name of a builtin
|
All builtin Clang headers need to be covered by the modulemap. This fixes llvm#166173 (cherry picked from commit 9ff31be)
All builtin Clang headers need to be covered by the modulemap. This fixes llvm#166173 (cherry picked from commit 9ff31be)
All builtin Clang headers need to be covered by the modulemap.
This fixes #166173