Skip to content

Commit aa9f041

Browse files
authored
Merge pull request swiftlang#24877 from benlangmuir/cant-validate-slow-if-we-dont-validate
[clang-importer] Fix option -disable-modules-validate-system-headers
2 parents a83349b + 2210d24 commit aa9f041

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
636636
invocationArgStrs.back().append(moduleCachePath);
637637
}
638638

639-
if (!importerOpts.DisableModulesValidateSystemHeaders) {
639+
if (importerOpts.DisableModulesValidateSystemHeaders) {
640+
invocationArgStrs.push_back("-fno-modules-validate-system-headers");
641+
} else {
640642
invocationArgStrs.push_back("-fmodules-validate-system-headers");
641643
}
642644

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %target-swift-frontend %s -parse -dump-clang-diagnostics 2>&1 | %FileCheck %s -check-prefix=DEFAULT
2+
// DEFAULT: -fmodules-validate-system-headers
3+
// DEFAULT-NOT: -fno-modules-validate-system-headers
4+
5+
// RUN: %target-swift-frontend %s -parse -dump-clang-diagnostics -disable-modules-validate-system-headers 2>&1 | %FileCheck %s -check-prefix=DISABLE
6+
// DISABLE: -fno-modules-validate-system-headers
7+
// DISABLE-NOT: -fmodules-validate-system-headers

0 commit comments

Comments
 (0)