aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2021-01-25 10:03:07 -0800
committerKeith Smiley <keithbsmiley@gmail.com>2021-01-25 10:14:04 -0800
commitc3324450b204392169d4ec7172cb32f74c03e376 (patch)
tree48046e8312929ecd40d20dfa2b72de7a15c679dd /clang/lib/Frontend/CompilerInvocation.cpp
parentf851db3dae5cc24ce1897918bd69fa989aa31b59 (diff)
downloadllvm-c3324450b204392169d4ec7172cb32f74c03e376.zip
llvm-c3324450b204392169d4ec7172cb32f74c03e376.tar.gz
llvm-c3324450b204392169d4ec7172cb32f74c03e376.tar.bz2
[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.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 6 insertions, 0 deletions
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,