[llvm] r231199 - LLParser: Avoid copying ValIDs, the copy ctor is deprecated in C++11 due to the presence of a user-declared dtor

David Blaikie dblaikie at gmail.com
Tue Mar 3 17:40:07 PST 2015


Author: dblaikie
Date: Tue Mar  3 19:40:07 2015
New Revision: 231199

URL: http://llvm.org/viewvc/llvm-project?rev=231199&view=rev
Log:
LLParser: Avoid copying ValIDs, the copy ctor is deprecated in C++11 due to the presence of a user-declared dtor

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

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=231199&r1=231198&r2=231199&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Tue Mar  3 19:40:07 2015
@@ -2512,7 +2512,12 @@ bool LLParser::ParseValID(ValID &ID, Per
 
     if (!F) {
       // Make a global variable as a placeholder for this reference.
-      GlobalValue *&FwdRef = ForwardRefBlockAddresses[Fn][Label];
+      GlobalValue *&FwdRef =
+          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)
         FwdRef = new GlobalVariable(*M, Type::getInt8Ty(Context), false,
                                     GlobalValue::InternalLinkage, nullptr, "");





More information about the llvm-commits mailing list