From d6d4a81839105bf46be7d10746df737894c5549c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 6 Nov 2014 20:32:54 -0800 Subject: [PATCH] use unordered_map --- tools/optimizer/minijson.h | 2 ++ tools/optimizer/optimizer.cpp | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/optimizer/minijson.h b/tools/optimizer/minijson.h index 6bdeabac1..5974c2816 100644 --- a/tools/optimizer/minijson.h +++ b/tools/optimizer/minijson.h @@ -4,6 +4,8 @@ * Uses shared_ptr for simplicity, basically everywhere. TODO: measure impact */ +//#define NDEBUG + #include #include #include diff --git a/tools/optimizer/optimizer.cpp b/tools/optimizer/optimizer.cpp index 9fdf6dc0d..c25b61800 100644 --- a/tools/optimizer/optimizer.cpp +++ b/tools/optimizer/optimizer.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include @@ -135,7 +134,7 @@ struct AsmData { AsmType type; bool param; // false if a var }; - typedef std::map Locals; + typedef std::unordered_map Locals; Locals locals; std::vector params; // in order @@ -971,7 +970,7 @@ void simplifyExpressions(Ref ast) { BitcastData() : define_HEAP32(0), define_HEAPF32(0), use_HEAP32(0), use_HEAPF32(0), namings(0), ok(false) {} }; - std::map bitcastVars; + std::unordered_map bitcastVars; traversePre(ast, [&bitcastVars](Ref node) { if (node[0] == "assign" && node[1]->isBool(true) && node[2][0] == "name") { Ref value = node[3];