Skip to content

Commit 40f8661

Browse files
committed
make the old -fdepscan-prefix-map= option driver-only
1 parent 81e58f3 commit 40f8661

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8836,7 +8836,7 @@ def fdepscan_include_tree : Flag<["-"], "fdepscan-include-tree">,
88368836
//
88378837
// FIXME: Add DepscanOption flag.
88388838
def fdepscan_prefix_map_EQ : Joined<["-"], "fdepscan-prefix-map=">,
8839-
Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
8839+
Group<f_Group>, Visibility<[ClangOption]>,
88408840
MetaVarName<"<old>=<new>">,
88418841
HelpText<"With -fdepscan, seamlessly filter the CAS filesystem to"
88428842
" apply the given prefix, updating the command-line to match.">;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5096,7 +5096,9 @@ void Clang::AddPrefixMappingOptions(const ArgList &Args, ArgStringList &CmdArgs,
50965096
D.Diag(diag::err_drv_invalid_argument_to_option)
50975097
<< A->getValue() << A->getOption().getName();
50985098
} else {
5099-
A->render(Args, CmdArgs);
5099+
CmdArgs.push_back("-fdepscan-prefix-map");
5100+
CmdArgs.push_back(Args.MakeArgString(Prefix));
5101+
CmdArgs.push_back(Args.MakeArgString(MapTarget));
51005102
}
51015103
}
51025104
}

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3391,12 +3391,6 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
33913391
assert(Values.size() == 2);
33923392
Opts.PathPrefixMappings.emplace_back(Values[0], Values[1]);
33933393
}
3394-
for (const Arg *A : Args.filtered(OPT_fdepscan_prefix_map_EQ)) {
3395-
StringRef Val = A->getValue();
3396-
if (std::optional<llvm::MappedPrefix> mapping = llvm::MappedPrefix::getFromJoined(Val)) {
3397-
Opts.PathPrefixMappings.emplace_back(mapping->Old, mapping->New);
3398-
}
3399-
}
34003394

34013395
if (Opts.ProgramAction != frontend::GenerateModule && Opts.IsSystemModule)
34023396
Diags.Report(diag::err_drv_argument_only_allowed_with) << "-fsystem-module"

0 commit comments

Comments
 (0)