Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -3353,7 +3353,7 @@ defm implicit_modules : BoolFOption<"implicit-modules",
NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
PosFlag<SetTrue>, BothFlags<
[NoXarchOption], [ClangOption, CLOption]>>;
def fno_modules_check_relocated : Joined<["-"], "fno-modules-check-relocated">,
def fno_modules_check_relocated : Flag<["-"], "fno-modules-check-relocated">,
Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Skip checks for relocated modules when loading PCM files">,
MarshallingInfoNegativeFlag<PreprocessorOpts<"ModulesCheckRelocated">>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,6 @@ class DependencyScanningAction : public tooling::ToolAction {
ScanInstance.getHeaderSearchOpts().ModulesSkipPragmaDiagnosticMappings =
true;

// Avoid some checks and module map parsing when loading PCM files.
ScanInstance.getPreprocessorOpts().ModulesCheckRelocated = false;

std::unique_ptr<FrontendAction> Action;

if (Service.getFormat() == ScanningOutputFormat::P1689)
Expand Down
36 changes: 36 additions & 0 deletions clang/test/ClangScanDeps/modules-relocated-module-map.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// RUN: rm -rf %t
// RUN: split-file %s %t

// RUN: mkdir %t/frameworks1

// RUN: clang-scan-deps -format experimental-full -- \
// RUN: %clang -fmodules -fmodules-cache-path=%t/cache \
// RUN: -F %t/frameworks1 -F %t/frameworks2 \
// RUN: -c %t/tu1.m -o %t/tu1.o

// RUN: cp -r %t/frameworks2/A.framework %t/frameworks1

// RUN: clang-scan-deps -format experimental-full -- \
// RUN: %clang -fmodules -fmodules-cache-path=%t/cache \
// RUN: -F %t/frameworks1 -F %t/frameworks2 \
// RUN: -c %t/tu2.m -o %t/tu2.o

//--- frameworks2/A.framework/Modules/module.modulemap
framework module A { header "A.h" }
//--- frameworks2/A.framework/Headers/A.h
#define MACRO_A 1

//--- frameworks2/B.framework/Modules/module.modulemap
framework module B { header "B.h" }
//--- frameworks2/B.framework/Headers/B.h
#include <A/A.h>

//--- tu1.m
#include <B/B.h>

//--- tu2.m
#include <A/A.h>
#include <B/B.h>

#if MACRO_A == 3
#endif
Loading