[llvm] 8b6320c - Address implicit conversions detected by g++ 5 only.

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


Author: Benjamin Kramer
Date: 2020-01-29T01:01:09+01:00
New Revision: 8b6320c79d4bf9a585f0533bb6007ff0697a9920

URL: https://github.com/llvm/llvm-project/commit/8b6320c79d4bf9a585f0533bb6007ff0697a9920
DIFF: https://github.com/llvm/llvm-project/commit/8b6320c79d4bf9a585f0533bb6007ff0697a9920.diff

LOG: Address implicit conversions detected by g++ 5 only.

Added: 
    

Modified: 
    llvm/lib/Support/TimeProfiler.cpp
    llvm/utils/TableGen/AsmMatcherEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index 4e48477f19ae..ddbf25fc0c52 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -184,7 +184,7 @@ struct TimeTraceProfiler {
     std::vector<NameAndCountAndDurationType> SortedTotals;
     SortedTotals.reserve(AllCountAndTotalPerName.size());
     for (const auto &Total : AllCountAndTotalPerName)
-      SortedTotals.emplace_back(Total.getKey(), Total.getValue());
+      SortedTotals.emplace_back(std::string(Total.getKey()), Total.getValue());
 
     llvm::sort(SortedTotals.begin(), SortedTotals.end(),
                [](const NameAndCountAndDurationType &A,

diff  --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index ce824f74051b..01133c13ae63 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -2601,7 +2601,7 @@ static void emitMatchRegisterName(CodeGenTarget &Target, Record *AsmParser,
     if (Reg.TheDef->getValueAsString("AsmName").empty())
       continue;
 
-    Matches.emplace_back(Reg.TheDef->getValueAsString("AsmName"),
+    Matches.emplace_back(std::string(Reg.TheDef->getValueAsString("AsmName")),
                          "return " + utostr(Reg.EnumValue) + ";");
   }
 
@@ -2633,7 +2633,7 @@ static void emitMatchRegisterAltName(CodeGenTarget &Target, Record *AsmParser,
       if (AltName.empty())
         continue;
 
-      Matches.emplace_back(AltName,
+      Matches.emplace_back(std::string(AltName),
                            "return " + utostr(Reg.EnumValue) + ";");
     }
   }


        


More information about the llvm-commits mailing list