| OLD | NEW |
| 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// | 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file defines aspects of the compilation that persist across | 10 // This file defines aspects of the compilation that persist across |
| 11 // multiple functions. | 11 // multiple functions. |
| 12 // | 12 // |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #include <ctype.h> // isdigit(), isupper() | 15 #include <ctype.h> // isdigit(), isupper() |
| 16 #include <locale> // locale | 16 #include <locale> // locale |
| 17 #include <unordered_map> | 17 #include <unordered_map> |
| 18 | 18 |
| 19 #include "IceCfg.h" | 19 #include "IceCfg.h" |
| 20 #include "IceClFlags.h" | 20 #include "IceClFlags.h" |
| 21 #include "IceDefs.h" | 21 #include "IceDefs.h" |
| 22 #include "IceGlobalContext.h" | 22 #include "IceGlobalContext.h" |
| 23 #include "IceGlobalInits.h" | 23 #include "IceGlobalInits.h" |
| 24 #include "IceOperand.h" | 24 #include "IceOperand.h" |
| 25 #include "IceTargetLowering.h" | 25 #include "IceTargetLowering.h" |
| 26 #include "IceTimerTree.h" | 26 #include "IceTimerTree.h" |
| 27 #include "IceTypes.h" | 27 #include "IceTypes.h" |
| 28 | 28 |
| 29 template <> struct std::hash<Ice::RelocatableTuple> { | 29 namespace std { |
| 30 std::size_t operator()(const Ice::RelocatableTuple &Key) const { | 30 template <> struct hash<Ice::RelocatableTuple> { |
| 31 return std::hash<Ice::IceString>()(Key.Name) + | 31 size_t operator()(const Ice::RelocatableTuple &Key) const { |
| 32 std::hash<Ice::RelocOffsetT>()(Key.Offset); | 32 return hash<Ice::IceString>()(Key.Name) + |
| 33 hash<Ice::RelocOffsetT>()(Key.Offset); |
| 33 } | 34 } |
| 34 }; | 35 }; |
| 36 } // end of namespace std |
| 35 | 37 |
| 36 namespace Ice { | 38 namespace Ice { |
| 37 | 39 |
| 38 // TypePool maps constants of type KeyType (e.g. float) to pointers to | 40 // TypePool maps constants of type KeyType (e.g. float) to pointers to |
| 39 // type ValueType (e.g. ConstantFloat). | 41 // type ValueType (e.g. ConstantFloat). |
| 40 template <Type Ty, typename KeyType, typename ValueType> class TypePool { | 42 template <Type Ty, typename KeyType, typename ValueType> class TypePool { |
| 41 TypePool(const TypePool &) = delete; | 43 TypePool(const TypePool &) = delete; |
| 42 TypePool &operator=(const TypePool &) = delete; | 44 TypePool &operator=(const TypePool &) = delete; |
| 43 | 45 |
| 44 public: | 46 public: |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } | 485 } |
| 484 | 486 |
| 485 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) | 487 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) |
| 486 : ID(ID), Ctx(Func->getContext()), | 488 : ID(ID), Ctx(Func->getContext()), |
| 487 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) { | 489 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) { |
| 488 if (Active) | 490 if (Active) |
| 489 Ctx->pushTimer(ID); | 491 Ctx->pushTimer(ID); |
| 490 } | 492 } |
| 491 | 493 |
| 492 } // end of namespace Ice | 494 } // end of namespace Ice |
| OLD | NEW |