[clang] ddf77f1 - One more batch of things found by g++ 6
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 28 15:51:19 PST 2020
Author: Benjamin Kramer
Date: 2020-01-29T00:50:34+01:00
New Revision: ddf77f10a301d04ab47ede3bed596b21cda44794
URL: https://github.com/llvm/llvm-project/commit/ddf77f10a301d04ab47ede3bed596b21cda44794
DIFF: https://github.com/llvm/llvm-project/commit/ddf77f10a301d04ab47ede3bed596b21cda44794.diff
LOG: One more batch of things found by g++ 6
Added:
Modified:
clang/tools/driver/cc1as_main.cpp
clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
Removed:
################################################################################
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp
index 87ba86758e5c..ce390b9f3b17 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/tools/driver/cc1as_main.cpp
@@ -245,8 +245,11 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
std::string(Args.getLastArgValue(OPT_fdebug_compilation_dir));
Opts.MainFileName = std::string(Args.getLastArgValue(OPT_main_file_name));
- for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ))
- Opts.DebugPrefixMap.insert(StringRef(Arg).split('='));
+ for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ)) {
+ auto Split = StringRef(Arg).split('=');
+ Opts.DebugPrefixMap.insert(
+ {std::string(Split.first), std::string(Split.second)});
+ }
// Frontend Options
if (Args.hasArg(OPT_INPUT)) {
diff --git a/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp b/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
index d98e3195a74d..41ef0d848963 100644
--- a/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
+++ b/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
@@ -28,7 +28,7 @@ class MockSema : public Parser::Sema {
// 'stmt()' to be all the same matcher.
// Use a more complex expression to prevent that.
ast_matchers::internal::Matcher<Stmt> M = stmt(stmt(), stmt());
- ExpectedMatchers.insert(std::make_pair(MatcherName, M));
+ ExpectedMatchers.insert(std::make_pair(std::string(MatcherName), M));
return M.getID().second;
}
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index ed6f9088bb4d..d0948fd9ab8c 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -511,8 +511,8 @@ LLVMSymbolizer::createModuleInfo(const ObjectFile *Obj,
std::unique_ptr<SymbolizableModule> SymMod;
if (InfoOrErr)
SymMod = std::move(*InfoOrErr);
- auto InsertResult =
- Modules.insert(std::make_pair(ModuleName, std::move(SymMod)));
+ auto InsertResult = Modules.insert(
+ std::make_pair(std::string(ModuleName), std::move(SymMod)));
assert(InsertResult.second);
if (std::error_code EC = InfoOrErr.getError())
return errorCodeToError(EC);
More information about the cfe-commits
mailing list