From c3324450b204392169d4ec7172cb32f74c03e376 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 25 Jan 2021 10:03:07 -0800 Subject: [clang] Add -fprofile-prefix-map This flag allows you to re-write absolute paths in coverage data analogous to -fdebug-prefix-map. This flag is also implied by -ffile-prefix-map. --- clang/lib/Frontend/CompilerInvocation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index d18e6b9..3656410 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -990,6 +990,12 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, {std::string(Split.first), std::string(Split.second)}); } + for (const auto &Arg : Args.getAllArgValues(OPT_fprofile_prefix_map_EQ)) { + auto Split = StringRef(Arg).split('='); + Opts.ProfilePrefixMap.insert( + {std::string(Split.first), std::string(Split.second)}); + } + const llvm::Triple::ArchType DebugEntryValueArchs[] = { llvm::Triple::x86, llvm::Triple::x86_64, llvm::Triple::aarch64, llvm::Triple::arm, llvm::Triple::armeb, llvm::Triple::mips, -- cgit v1.1