Chromium Code Reviews| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 } | 335 } |
| 336 | 336 |
| 337 // Ensure Pending is large enough that Pending[Index] is valid. | 337 // Ensure Pending is large enough that Pending[Index] is valid. |
| 338 void resizePending(std::vector<EmitterWorkItem *> &Pending, uint32_t Index) { | 338 void resizePending(std::vector<EmitterWorkItem *> &Pending, uint32_t Index) { |
| 339 if (Index >= Pending.size()) | 339 if (Index >= Pending.size()) |
| 340 Pending.resize(Index + 1); | 340 Pending.resize(Index + 1); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // end of anonymous namespace | 343 } // end of anonymous namespace |
| 344 | 344 |
| 345 void GlobalContext::emitFileHeader() { | |
| 346 TimerMarker T1(Ice::TimerStack::TT_emit, this); | |
| 347 if (getFlags().getOutFileType() == FT_Elf) { | |
| 348 getObjectWriter()->writeInitialELFHeader(); | |
| 349 } else { | |
| 350 if (!ALLOW_DUMP) | |
| 351 llvm::report_fatal_error("emitFileHeader for non-ELF"); | |
| 352 TargetHeaderLowering::createLowering(this)->lower(); | |
|
jvoung (off chromium)
2015/06/05 22:05:54
Or maybe the flag check and writeInitialELFHeader
| |
| 353 } | |
| 354 } | |
| 355 | |
| 345 void GlobalContext::emitItems() { | 356 void GlobalContext::emitItems() { |
| 346 const bool Threaded = !getFlags().isSequential(); | 357 const bool Threaded = !getFlags().isSequential(); |
| 347 // Pending is a vector containing the reassembled, ordered list of | 358 // Pending is a vector containing the reassembled, ordered list of |
| 348 // work items. When we're ready for the next item, we first check | 359 // work items. When we're ready for the next item, we first check |
| 349 // whether it's in the Pending list. If not, we take an item from | 360 // whether it's in the Pending list. If not, we take an item from |
| 350 // the work queue, and if it's not the item we're waiting for, we | 361 // the work queue, and if it's not the item we're waiting for, we |
| 351 // insert it into Pending and repeat. The work item is deleted | 362 // insert it into Pending and repeat. The work item is deleted |
| 352 // after it is processed. | 363 // after it is processed. |
| 353 std::vector<EmitterWorkItem *> Pending; | 364 std::vector<EmitterWorkItem *> Pending; |
| 354 uint32_t DesiredSequenceNumber = getFirstSequenceNumber(); | 365 uint32_t DesiredSequenceNumber = getFirstSequenceNumber(); |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 829 Ctx = Func->getContext(); | 840 Ctx = Func->getContext(); |
| 830 Active = | 841 Active = |
| 831 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 842 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 832 if (Active) | 843 if (Active) |
| 833 Ctx->pushTimer(ID, StackID); | 844 Ctx->pushTimer(ID, StackID); |
| 834 } | 845 } |
| 835 | 846 |
| 836 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 847 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 837 | 848 |
| 838 } // end of namespace Ice | 849 } // end of namespace Ice |
| OLD | NEW |