| OLD | NEW |
| 1 //===- subzero/src/IceGlobalContext.h - Global context defs -----*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.h - 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 /// \file | 10 /// \file |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 | 614 |
| 615 void accumulateGlobals(std::unique_ptr<VariableDeclarationList> Globls) { | 615 void accumulateGlobals(std::unique_ptr<VariableDeclarationList> Globls) { |
| 616 LockedPtr<VariableDeclarationList> _(&Globals, &InitAllocLock); | 616 LockedPtr<VariableDeclarationList> _(&Globals, &InitAllocLock); |
| 617 if (Globls != nullptr) { | 617 if (Globls != nullptr) { |
| 618 Globals.merge(Globls.get()); | 618 Globals.merge(Globls.get()); |
| 619 if (!BuildDefs::minimal() && Instrumentor != nullptr) | 619 if (!BuildDefs::minimal() && Instrumentor != nullptr) |
| 620 Instrumentor->setHasSeenGlobals(); | 620 Instrumentor->setHasSeenGlobals(); |
| 621 } | 621 } |
| 622 } | 622 } |
| 623 | 623 |
| 624 void lowerGlobalsIfNoCodeHasBeenSeen() { | 624 void lowerGlobalsIfNoCodeHasBeenSeen(); |
| 625 if (HasSeenCode) | |
| 626 return; | |
| 627 constexpr char NoSuffix[] = ""; | |
| 628 lowerGlobals(NoSuffix); | |
| 629 HasSeenCode = true; | |
| 630 } | |
| 631 | 625 |
| 632 void saveBlockInfoPtrs(); | 626 void saveBlockInfoPtrs(); |
| 633 | 627 |
| 634 llvm::SmallVector<ThreadContext *, 128> AllThreadContexts; | 628 llvm::SmallVector<ThreadContext *, 128> AllThreadContexts; |
| 635 llvm::SmallVector<std::thread, 128> TranslationThreads; | 629 llvm::SmallVector<std::thread, 128> TranslationThreads; |
| 636 llvm::SmallVector<std::thread, 128> EmitterThreads; | 630 llvm::SmallVector<std::thread, 128> EmitterThreads; |
| 637 // Each thread has its own TLS pointer which is also held in | 631 // Each thread has its own TLS pointer which is also held in |
| 638 // AllThreadContexts. | 632 // AllThreadContexts. |
| 639 ICE_TLS_DECLARE_FIELD(ThreadContext *, TLS); | 633 ICE_TLS_DECLARE_FIELD(ThreadContext *, TLS); |
| 640 | 634 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 692 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
| 699 ~OstreamLocker() { Ctx->unlockStr(); } | 693 ~OstreamLocker() { Ctx->unlockStr(); } |
| 700 | 694 |
| 701 private: | 695 private: |
| 702 GlobalContext *const Ctx; | 696 GlobalContext *const Ctx; |
| 703 }; | 697 }; |
| 704 | 698 |
| 705 } // end of namespace Ice | 699 } // end of namespace Ice |
| 706 | 700 |
| 707 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 701 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |