| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 continue; // Func goes out of scope and gets deleted | 191 continue; // Func goes out of scope and gets deleted |
| 192 } | 192 } |
| 193 Func->translate(); | 193 Func->translate(); |
| 194 EmitterWorkItem *Item = nullptr; | 194 EmitterWorkItem *Item = nullptr; |
| 195 if (Func->hasError()) { | 195 if (Func->hasError()) { |
| 196 getErrorStatus()->assign(EC_Translation); | 196 getErrorStatus()->assign(EC_Translation); |
| 197 OstreamLocker L(this); | 197 OstreamLocker L(this); |
| 198 getStrDump() << "ICE translation error: " << Func->getError() << "\n"; | 198 getStrDump() << "ICE translation error: " << Func->getError() << "\n"; |
| 199 Item = new EmitterWorkItem(Func->getSequenceNumber()); | 199 Item = new EmitterWorkItem(Func->getSequenceNumber()); |
| 200 } else { | 200 } else { |
| 201 Func->getAssembler<>()->setInternal(Func->getInternal()); |
| 201 switch (getFlags().getOutFileType()) { | 202 switch (getFlags().getOutFileType()) { |
| 202 case FT_Elf: | 203 case FT_Elf: |
| 203 case FT_Iasm: { | 204 case FT_Iasm: { |
| 204 Func->emitIAS(); | 205 Func->emitIAS(); |
| 205 // The Cfg has already emitted into the assembly buffer, so | 206 // The Cfg has already emitted into the assembly buffer, so |
| 206 // stats have been fully collected into this thread's TLS. | 207 // stats have been fully collected into this thread's TLS. |
| 207 // Dump them before TLS is reset for the next Cfg. | 208 // Dump them before TLS is reset for the next Cfg. |
| 208 dumpStats(Func->getFunctionName()); | 209 dumpStats(Func->getFunctionName()); |
| 209 Assembler *Asm = Func->releaseAssembler(); | 210 Assembler *Asm = Func->releaseAssembler(); |
| 210 // Copy relevant fields into Asm before Func is deleted. | 211 // Copy relevant fields into Asm before Func is deleted. |
| 211 Asm->setFunctionName(Func->getFunctionName()); | 212 Asm->setFunctionName(Func->getFunctionName()); |
| 212 Asm->setInternal(Func->getInternal()); | |
| 213 Item = new EmitterWorkItem(Func->getSequenceNumber(), Asm); | 213 Item = new EmitterWorkItem(Func->getSequenceNumber(), Asm); |
| 214 } break; | 214 } break; |
| 215 case FT_Asm: | 215 case FT_Asm: |
| 216 // The Cfg has not been emitted yet, so stats are not ready | 216 // The Cfg has not been emitted yet, so stats are not ready |
| 217 // to be dumped. | 217 // to be dumped. |
| 218 Item = new EmitterWorkItem(Func->getSequenceNumber(), Func.release()); | 218 Item = new EmitterWorkItem(Func->getSequenceNumber(), Func.release()); |
| 219 break; | 219 break; |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 Cfg::setCurrentCfg(nullptr); | 222 Cfg::setCurrentCfg(nullptr); |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 Ctx = Func->getContext(); | 740 Ctx = Func->getContext(); |
| 741 Active = | 741 Active = |
| 742 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 742 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 743 if (Active) | 743 if (Active) |
| 744 Ctx->pushTimer(ID, StackID); | 744 Ctx->pushTimer(ID, StackID); |
| 745 } | 745 } |
| 746 | 746 |
| 747 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 747 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 748 | 748 |
| 749 } // end of namespace Ice | 749 } // end of namespace Ice |
| OLD | NEW |