diff options
author | Chih-Wei Huang <[email protected]> | 2015-10-15 23:46:30 +0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-10-21 14:23:21 +0100 |
commit | 938df905ea76b815d796567ff0b01886be0523dd (patch) | |
tree | 4f79a919991c8e7bf60f976a427cce016e0ff38e /src/gallium | |
parent | 9b561ed2d189ad65ecdfb274b10b4984927865c8 (diff) |
nv50/ir: use C++11 standard std::unordered_map if possible
Note Android version before Lollipop is not supported.
Signed-off-by: Chih-Wei Huang <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Cc: [email protected]
(cherry picked from commit d31005e3e5588b20760c774f14ac0ea80375a181)
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index 400b9f09e51..7859c8e79bd 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -25,10 +25,24 @@ #include <stack> #include <limits> +#if __cplusplus >= 201103L +#include <unordered_map> +#else #include <tr1/unordered_map> +#endif namespace nv50_ir { +#if __cplusplus >= 201103L +using std::hash; +using std::unordered_map; +#elif !defined(ANDROID) +using std::tr1::hash; +using std::tr1::unordered_map; +#else +#error Android release before Lollipop is not supported! +#endif + #define MAX_REGISTER_FILE_SIZE 256 class RegisterSet @@ -349,12 +363,12 @@ RegAlloc::PhiMovesPass::needNewElseBlock(BasicBlock *b, BasicBlock *p) struct PhiMapHash { size_t operator()(const std::pair<Instruction *, BasicBlock *>& val) const { - return std::tr1::hash<Instruction*>()(val.first) * 31 + - std::tr1::hash<BasicBlock*>()(val.second); + return hash<Instruction*>()(val.first) * 31 + + hash<BasicBlock*>()(val.second); } }; -typedef std::tr1::unordered_map< +typedef unordered_map< std::pair<Instruction *, BasicBlock *>, Value *, PhiMapHash> PhiMap; // Critical edges need to be split up so that work can be inserted along |