[llvm] r243899 - Try to fix the build for C++ standard libraries missing std::map::emplace

David Blaikie dblaikie at gmail.com
Mon Aug 3 13:30:53 PDT 2015


Author: dblaikie
Date: Mon Aug  3 15:30:53 2015
New Revision: 243899

URL: http://llvm.org/viewvc/llvm-project?rev=243899&view=rev
Log:
Try to fix the build for C++ standard libraries missing std::map::emplace

Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp
    llvm/trunk/lib/AsmParser/LLParser.h

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=243899&r1=243898&r2=243899&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Aug  3 15:30:53 2015
@@ -2609,9 +2609,8 @@ bool LLParser::ParseValID(ValID &ID, Per
     if (!F) {
       // Make a global variable as a placeholder for this reference.
       GlobalValue *&FwdRef =
-          ForwardRefBlockAddresses.emplace(std::piecewise_construct,
-                                           std::forward_as_tuple(std::move(Fn)),
-                                           std::forward_as_tuple())
+          ForwardRefBlockAddresses.insert(std::make_pair, std::move(Fn),
+                                          std::map<ValID, GlobalValue *>())
               .first->second.insert(std::make_pair(std::move(Label), nullptr))
               .first->second;
       if (!FwdRef)

Modified: llvm/trunk/lib/AsmParser/LLParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.h?rev=243899&r1=243898&r2=243899&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.h (original)
+++ llvm/trunk/lib/AsmParser/LLParser.h Mon Aug  3 15:30:53 2015
@@ -67,12 +67,12 @@ namespace llvm {
     std::unique_ptr<Constant *[]> ConstantStructElts;
 
     ValID() = default;
-    ValID(ValID &&RHS)
+    ValID(const ValID &RHS)
         : Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy),
-          StrVal(std::move(RHS.StrVal)), StrVal2(std::move(RHS.StrVal2)),
-          APSIntVal(std::move(RHS.APSIntVal)),
-          APFloatVal(std::move(RHS.APFloatVal)), ConstantVal(RHS.ConstantVal),
-          ConstantStructElts(std::move(RHS.ConstantStructElts)) {}
+          StrVal(RHS.StrVal), StrVal2(RHS.StrVal2), APSIntVal(RHS.APSIntVal),
+          APFloatVal(RHS.APFloatVal), ConstantVal(RHS.ConstantVal) {
+      assert(!RHS.ConstantStructElts);
+    }
 
     bool operator<(const ValID &RHS) const {
       if (Kind == t_LocalID || Kind == t_GlobalID)





More information about the llvm-commits mailing list