[llvm] 735f90f - Fix one round of implicit conversions found by g++5.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 16:52:58 PST 2020


Author: Benjamin Kramer
Date: 2020-01-29T01:52:48+01:00
New Revision: 735f90fe42e55935035d842752e01361b5216c11

URL: https://github.com/llvm/llvm-project/commit/735f90fe42e55935035d842752e01361b5216c11
DIFF: https://github.com/llvm/llvm-project/commit/735f90fe42e55935035d842752e01361b5216c11.diff

LOG: Fix one round of implicit conversions found by g++5.

Added: 
    

Modified: 
    clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
    clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
    clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
    llvm/lib/TextAPI/MachO/InterfaceFile.cpp
    llvm/tools/gold/gold-plugin.cpp

Removed: 
    


################################################################################
diff  --git a/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp b/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
index a25ab116a75d..15671a99a3fc 100644
--- a/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
+++ b/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
@@ -66,7 +66,7 @@ void clang::EmitClangCommentHTMLNamedCharacterReferences(RecordKeeper &Records,
     }
     CLiteral.append(";");
 
-    StringMatcher::StringPair Match(Spelling, CLiteral.str());
+    StringMatcher::StringPair Match(Spelling, std::string(CLiteral.str()));
     NameToUTF8.push_back(Match);
   }
 

diff  --git a/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp b/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
index 1c15029bbc41..78bbbd1cba57 100644
--- a/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
+++ b/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
@@ -23,7 +23,8 @@ void clang::EmitClangCommentHTMLTags(RecordKeeper &Records, raw_ostream &OS) {
   std::vector<Record *> Tags = Records.getAllDerivedDefinitions("Tag");
   std::vector<StringMatcher::StringPair> Matches;
   for (Record *Tag : Tags) {
-    Matches.emplace_back(Tag->getValueAsString("Spelling"), "return true;");
+    Matches.emplace_back(std::string(Tag->getValueAsString("Spelling")),
+                         "return true;");
   }
 
   emitSourceFileHeader("HTML tag name matcher", OS);

diff  --git a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
index 41d33b550680..85933e6d3bd3 100644
--- a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -597,7 +597,8 @@ void BuiltinNameEmitter::EmitStringMatcher() {
       SS << "return std::make_pair(" << CumulativeIndex << ", " << Ovl.size()
          << ");";
       SS.flush();
-      ValidBuiltins.push_back(StringMatcher::StringPair(FctName, RetStmt));
+      ValidBuiltins.push_back(
+          StringMatcher::StringPair(std::string(FctName), RetStmt));
     }
     CumulativeIndex += Ovl.size();
   }

diff  --git a/llvm/lib/TextAPI/MachO/InterfaceFile.cpp b/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
index 9f084560d5fe..aae5c231a62a 100644
--- a/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
+++ b/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
@@ -67,7 +67,7 @@ void InterfaceFile::addParentUmbrella(const Target &Target_, StringRef Parent) {
     return;
   }
 
-  ParentUmbrellas.emplace(Iter, Target_, Parent);
+  ParentUmbrellas.emplace(Iter, Target_, std::string(Parent));
   return;
 }
 

diff  --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index f5d47d68a51d..d0d837fb0c79 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -279,11 +279,11 @@ namespace options {
     } else if (opt == "disable-verify") {
       DisableVerify = true;
     } else if (opt.startswith("sample-profile=")) {
-      sample_profile = opt.substr(strlen("sample-profile="));
+      sample_profile = std::string(opt.substr(strlen("sample-profile=")));
     } else if (opt == "cs-profile-generate") {
       cs_pgo_gen = true;
     } else if (opt.startswith("cs-profile-path=")) {
-      cs_profile_path = opt.substr(strlen("cs-profile-path="));
+      cs_profile_path = std::string(opt.substr(strlen("cs-profile-path=")));
     } else if (opt == "new-pass-manager") {
       new_pass_manager = true;
     } else if (opt == "debug-pass-manager") {
@@ -291,17 +291,18 @@ namespace options {
     } else if (opt == "whole-program-visibility") {
       whole_program_visibility = true;
     } else if (opt.startswith("dwo_dir=")) {
-      dwo_dir = opt.substr(strlen("dwo_dir="));
+      dwo_dir = std::string(opt.substr(strlen("dwo_dir=")));
     } else if (opt.startswith("opt-remarks-filename=")) {
-      RemarksFilename = opt.substr(strlen("opt-remarks-filename="));
+      RemarksFilename =
+          std::string(opt.substr(strlen("opt-remarks-filename=")));
     } else if (opt.startswith("opt-remarks-passes=")) {
-      RemarksPasses = opt.substr(strlen("opt-remarks-passes="));
+      RemarksPasses = std::string(opt.substr(strlen("opt-remarks-passes=")));
     } else if (opt == "opt-remarks-with-hotness") {
       RemarksWithHotness = true;
     } else if (opt.startswith("opt-remarks-format=")) {
-      RemarksFormat = opt.substr(strlen("opt-remarks-format="));
+      RemarksFormat = std::string(opt.substr(strlen("opt-remarks-format=")));
     } else if (opt.startswith("stats-file=")) {
-      stats_file = opt.substr(strlen("stats-file="));
+      stats_file = std::string(opt.substr(strlen("stats-file=")));
     } else {
       // Save this option to pass to the code generator.
       // ParseCommandLineOptions() expects argv[0] to be program name. Lazily
@@ -683,7 +684,9 @@ static void getThinLTOOldAndNewSuffix(std::string &OldSuffix,
   assert(options::thinlto_object_suffix_replace.empty() ||
          options::thinlto_object_suffix_replace.find(";") != StringRef::npos);
   StringRef SuffixReplace = options::thinlto_object_suffix_replace;
-  std::tie(OldSuffix, NewSuffix) = SuffixReplace.split(';');
+  auto Split = SuffixReplace.split(';');
+  OldSuffix = Split.first;
+  NewSuffix = Split.second;
 }
 
 /// Given the original \p Path to an output file, replace any filename


        


More information about the llvm-commits mailing list