| 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 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 void addAllIfNotNull(std::unique_ptr<VariableDeclarationList> src, | 394 void addAllIfNotNull(std::unique_ptr<VariableDeclarationList> src, |
| 395 VariableDeclarationList *dst) { | 395 VariableDeclarationList *dst) { |
| 396 if (src != nullptr) { | 396 if (src != nullptr) { |
| 397 dst->insert(dst->end(), src->begin(), src->end()); | 397 dst->insert(dst->end(), src->begin(), src->end()); |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // end of anonymous namespace | 401 } // end of anonymous namespace |
| 402 | 402 |
| 403 void GlobalContext::emitFileHeader() { |
| 404 TimerMarker T1(Ice::TimerStack::TT_emit, this); |
| 405 if (getFlags().getOutFileType() == FT_Elf) { |
| 406 getObjectWriter()->writeInitialELFHeader(); |
| 407 } else { |
| 408 if (!ALLOW_DUMP) |
| 409 llvm::report_fatal_error("emitFileHeader for non-ELF"); |
| 410 TargetHeaderLowering::createLowering(this)->lower(); |
| 411 } |
| 412 } |
| 413 |
| 403 void GlobalContext::emitItems() { | 414 void GlobalContext::emitItems() { |
| 404 const bool Threaded = !getFlags().isSequential(); | 415 const bool Threaded = !getFlags().isSequential(); |
| 405 // Pending is a vector containing the reassembled, ordered list of | 416 // Pending is a vector containing the reassembled, ordered list of |
| 406 // work items. When we're ready for the next item, we first check | 417 // work items. When we're ready for the next item, we first check |
| 407 // whether it's in the Pending list. If not, we take an item from | 418 // whether it's in the Pending list. If not, we take an item from |
| 408 // the work queue, and if it's not the item we're waiting for, we | 419 // the work queue, and if it's not the item we're waiting for, we |
| 409 // insert it into Pending and repeat. The work item is deleted | 420 // insert it into Pending and repeat. The work item is deleted |
| 410 // after it is processed. | 421 // after it is processed. |
| 411 std::unique_ptr<VariableDeclarationList> GlobalInits( | 422 std::unique_ptr<VariableDeclarationList> GlobalInits( |
| 412 new VariableDeclarationList()); | 423 new VariableDeclarationList()); |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 Ctx = Func->getContext(); | 906 Ctx = Func->getContext(); |
| 896 Active = | 907 Active = |
| 897 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 908 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 898 if (Active) | 909 if (Active) |
| 899 Ctx->pushTimer(ID, StackID); | 910 Ctx->pushTimer(ID, StackID); |
| 900 } | 911 } |
| 901 | 912 |
| 902 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 913 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 903 | 914 |
| 904 } // end of namespace Ice | 915 } // end of namespace Ice |
| OLD | NEW |