| OLD | NEW |
| 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs ---*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs ---*- C++ -*-===// |
| 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 | 17 |
| 17 #include "IceDefs.h" | 18 #include "IceDefs.h" |
| 18 #include "IceTypes.h" | 19 #include "IceTypes.h" |
| 19 #include "IceCfg.h" | 20 #include "IceCfg.h" |
| 20 #include "IceGlobalContext.h" | 21 #include "IceGlobalContext.h" |
| 21 #include "IceOperand.h" | 22 #include "IceOperand.h" |
| 22 #include "IceTargetLowering.h" | 23 #include "IceTargetLowering.h" |
| 23 | 24 |
| 24 namespace Ice { | 25 namespace Ice { |
| 25 | 26 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 E = Pool.end(); | 55 E = Pool.end(); |
| 55 I != E; ++I) { | 56 I != E; ++I) { |
| 56 Constants.push_back(I->second); | 57 Constants.push_back(I->second); |
| 57 } | 58 } |
| 58 return Constants; | 59 return Constants; |
| 59 } | 60 } |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 typedef std::pair<Type, KeyType> TupleType; | 63 typedef std::pair<Type, KeyType> TupleType; |
| 63 struct TupleCompare { | 64 struct TupleCompare { |
| 64 bool operator()(const TupleType &A, const TupleType &B) { | 65 bool operator()(const TupleType &A, const TupleType &B) const { |
| 65 if (A.first != B.first) | 66 if (A.first != B.first) |
| 66 return A.first < B.first; | 67 return A.first < B.first; |
| 67 if (KeyTypeHasFP) | 68 if (KeyTypeHasFP) |
| 68 return memcmp(&A.second, &B.second, sizeof(KeyType)) < 0; | 69 return memcmp(&A.second, &B.second, sizeof(KeyType)) < 0; |
| 69 return A.second < B.second; | 70 return A.second < B.second; |
| 70 } | 71 } |
| 71 }; | 72 }; |
| 72 typedef std::map<const TupleType, ValueType *, TupleCompare> ContainerType; | 73 typedef std::map<const TupleType, ValueType *, TupleCompare> ContainerType; |
| 73 ContainerType Pool; | 74 ContainerType Pool; |
| 74 uint32_t NextPoolID; | 75 uint32_t NextPoolID; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 374 |
| 374 void Timer::printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const { | 375 void Timer::printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const { |
| 375 if (Ctx->isVerbose(IceV_Timing)) { | 376 if (Ctx->isVerbose(IceV_Timing)) { |
| 376 // Prefixing with '#' allows timing strings to be included | 377 // Prefixing with '#' allows timing strings to be included |
| 377 // without error in textual assembly output. | 378 // without error in textual assembly output. |
| 378 Ctx->getStrDump() << "# " << getElapsedUs() << " usec " << Tag << "\n"; | 379 Ctx->getStrDump() << "# " << getElapsedUs() << " usec " << Tag << "\n"; |
| 379 } | 380 } |
| 380 } | 381 } |
| 381 | 382 |
| 382 } // end of namespace Ice | 383 } // end of namespace Ice |
| OLD | NEW |