[llvm] r260816 - [Hexagon] Replace use of "std::map::emplace" with "insert"

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 13 06:06:02 PST 2016


Author: kparzysz
Date: Sat Feb 13 08:06:01 2016
New Revision: 260816

URL: http://llvm.org/viewvc/llvm-project?rev=260816&view=rev
Log:
[Hexagon] Replace use of "std::map::emplace" with "insert"

Gcc 4.7.2-4 does not seem to have "emplace" in its implementation of map.
This should fix the build failure on polly-amd64-linux.


Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp?rev=260816&r1=260815&r2=260816&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp Sat Feb 13 08:06:01 2016
@@ -1762,7 +1762,10 @@ void HexagonFrameLowering::optimizeSpill
   // and collect relevant information.
   for (auto &B : MF) {
     std::map<int,IndexType> LastStore, LastLoad;
-    auto P = BlockIndexes.emplace(&B, HexagonBlockRanges::InstrIndexMap(B));
+    // Emplace appears not to be supported in gcc 4.7.2-4.
+    //auto P = BlockIndexes.emplace(&B, HexagonBlockRanges::InstrIndexMap(B));
+    auto TmpP = std::make_pair(&B, HexagonBlockRanges::InstrIndexMap(B));
+    auto P = BlockIndexes.insert(TmpP);
     auto &IndexMap = P.first->second;
     DEBUG(dbgs() << "Index map for BB#" << B.getNumber() << "\n"
                  << IndexMap << '\n');




More information about the llvm-commits mailing list