| 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 /// \file | 10 /// \file |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 | 715 |
| 716 // Transform bar ==> Prefixbar | 716 // Transform bar ==> Prefixbar |
| 717 // ^^^^^^ | 717 // ^^^^^^ |
| 718 return TestPrefix + Name; | 718 return TestPrefix + Name; |
| 719 } | 719 } |
| 720 | 720 |
| 721 GlobalContext::~GlobalContext() { | 721 GlobalContext::~GlobalContext() { |
| 722 llvm::DeleteContainerPointers(AllThreadContexts); | 722 llvm::DeleteContainerPointers(AllThreadContexts); |
| 723 LockedPtr<DestructorArray> Dtors = getDestructors(); | 723 LockedPtr<DestructorArray> Dtors = getDestructors(); |
| 724 // Destructors are invoked in the opposite object construction order. | 724 // Destructors are invoked in the opposite object construction order. |
| 725 for (auto DtorIter = Dtors->crbegin(); DtorIter != Dtors->crend(); | 725 for (const auto &Dtor : reverse_range(*Dtors)) |
| 726 ++DtorIter) { | 726 Dtor(); |
| 727 (*DtorIter)(); | |
| 728 } | |
| 729 } | 727 } |
| 730 | 728 |
| 731 // TODO(stichnot): Consider adding thread-local caches of constant pool entries | 729 // TODO(stichnot): Consider adding thread-local caches of constant pool entries |
| 732 // to reduce contention. | 730 // to reduce contention. |
| 733 | 731 |
| 734 // All locking is done by the getConstantInt[0-9]+() target function. | 732 // All locking is done by the getConstantInt[0-9]+() target function. |
| 735 Constant *GlobalContext::getConstantInt(Type Ty, int64_t Value) { | 733 Constant *GlobalContext::getConstantInt(Type Ty, int64_t Value) { |
| 736 switch (Ty) { | 734 switch (Ty) { |
| 737 case IceType_i1: | 735 case IceType_i1: |
| 738 return getConstantInt1(Value); | 736 return getConstantInt1(Value); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 Ctx = Func->getContext(); | 1007 Ctx = Func->getContext(); |
| 1010 Active = | 1008 Active = |
| 1011 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 1009 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 1012 if (Active) | 1010 if (Active) |
| 1013 Ctx->pushTimer(ID, StackID); | 1011 Ctx->pushTimer(ID, StackID); |
| 1014 } | 1012 } |
| 1015 | 1013 |
| 1016 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 1014 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 1017 | 1015 |
| 1018 } // end of namespace Ice | 1016 } // end of namespace Ice |
| OLD | NEW |