From 01a17832dee4fbbf06c9f18f5e70a6714594e847 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 12 Feb 2014 18:07:23 -0800 Subject: Map optimizations. --- lib/Target/JSBackend/JSBackend.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Target/JSBackend/JSBackend.cpp') diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index b70e2971a3..8255518293 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -170,10 +170,11 @@ namespace { // return the absolute offset of a global unsigned getGlobalAddress(const std::string &s) { - if (GlobalAddresses.find(s) == GlobalAddresses.end()) { + GlobalAddressMap::iterator I = GlobalAddresses.find(s); + if (I == GlobalAddresses.end()) { report_fatal_error("cannot find global address " + Twine(s)); } - Address a = GlobalAddresses[s]; + Address a = I->second; assert(a.second == 64); // FIXME when we use optimal alignments unsigned Ret; switch (a.second) { @@ -216,10 +217,11 @@ namespace { } // returns the internal offset inside the proper block: GlobalData8, 32, 64 unsigned getRelativeGlobalAddress(const std::string &s) { - if (GlobalAddresses.find(s) == GlobalAddresses.end()) { + GlobalAddressMap::iterator I = GlobalAddresses.find(s); + if (I == GlobalAddresses.end()) { report_fatal_error("cannot find global address " + Twine(s)); } - Address a = GlobalAddresses[s]; + Address a = I->second; return a.first; } char getFunctionSignatureLetter(Type *T) { -- cgit v1.2.3-18-g5258