Add a SafeMap equivalent to std::map but without the error-prone operator[].
Change-Id: Iae5ba2091c55a34dbd1005cf3d25fce2a8d5c1f9
diff --git a/src/compiler/CompilerIR.h b/src/compiler/CompilerIR.h
index 0fc26de..88593bd 100644
--- a/src/compiler/CompilerIR.h
+++ b/src/compiler/CompilerIR.h
@@ -17,10 +17,12 @@
#ifndef ART_SRC_COMPILER_COMPILER_IR_H_
#define ART_SRC_COMPILER_COMPILER_IR_H_
+#include <vector>
+
#include "codegen/Optimizer.h"
#include "CompilerUtility.h"
-#include <vector>
#include "oat_compilation_unit.h"
+#include "safe_map.h"
namespace art {
@@ -519,8 +521,8 @@
const u2* insns;
u4 insnsSize;
bool disableDataflow; // Skip dataflow analysis if possible
- std::map<unsigned int, BasicBlock*> blockMap; // findBlock lookup cache
- std::map<unsigned int, LIR*> boundaryMap; // boundary lookup cache
+ SafeMap<unsigned int, BasicBlock*> blockMap; // findBlock lookup cache
+ SafeMap<unsigned int, LIR*> boundaryMap; // boundary lookup cache
int defCount; // Used to estimate number of SSA names
// If non-empty, apply optimizer/debug flags only to matching methods.