aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorGulfem Savrun Yeniceri <gulfem@google.com>2023-04-26 22:49:09 +0000
committerGulfem Savrun Yeniceri <gulfem@google.com>2023-04-27 00:24:18 +0000
commitd7fa92126cc398b993f301273816739b23ed8740 (patch)
treed12523c1b057b007b2c2135a19a3c61e73124e98 /clang/lib/Frontend/CompilerInvocation.cpp
parent5854b39847251fded061b46ba03df6a361deadf8 (diff)
downloadllvm-d7fa92126cc398b993f301273816739b23ed8740.zip
llvm-d7fa92126cc398b993f301273816739b23ed8740.tar.gz
llvm-d7fa92126cc398b993f301273816739b23ed8740.tar.bz2
[clang] Apply -fcoverage-prefix-map reverse order
This patch changes handling multiple -fcoverage-prefix-map options to match GCC's behavior. GCC applies prefix remappings that are provided in reverse order (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109591). Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D148757
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index a148136..cbd2663 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1701,8 +1701,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
for (const auto &Arg : Args.getAllArgValues(OPT_fcoverage_prefix_map_EQ)) {
auto Split = StringRef(Arg).split('=');
- Opts.CoveragePrefixMap.insert(
- {std::string(Split.first), std::string(Split.second)});
+ Opts.CoveragePrefixMap.emplace_back(Split.first, Split.second);
}
const llvm::Triple::ArchType DebugEntryValueArchs[] = {