From 280a50ebb9dd8c8147ac3f2d94ab0bfc9ab9ae8f Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Sat, 13 Feb 2016 14:06:01 +0000 Subject: [PATCH] [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. llvm-svn: 260816 --- llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp index 628778703959..42c94091b9e4 100644 --- a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp @@ -1762,7 +1762,10 @@ void HexagonFrameLowering::optimizeSpillSlots(MachineFunction &MF, // and collect relevant information. for (auto &B : MF) { std::map 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');