OLD | NEW |
(Empty) | |
| 1 //===- subzero/src/IceThreading.cpp - Threading function definitions ------===// |
| 2 // |
| 3 // The Subzero Code Generator |
| 4 // |
| 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. |
| 7 // |
| 8 //===----------------------------------------------------------------------===// |
| 9 // |
| 10 // This file defines threading-related functions. |
| 11 // |
| 12 //===----------------------------------------------------------------------===// |
| 13 |
| 14 #include "IceCfg.h" |
| 15 #include "IceDefs.h" |
| 16 #include "IceThreading.h" |
| 17 |
| 18 namespace Ice { |
| 19 |
| 20 EmitterWorkItem::EmitterWorkItem(uint32_t Seq) |
| 21 : Sequence(Seq), Kind(WI_Nop), GlobalInits(nullptr), Function(nullptr), |
| 22 RawFunc(nullptr) {} |
| 23 EmitterWorkItem::EmitterWorkItem(uint32_t Seq, VariableDeclarationList *D) |
| 24 : Sequence(Seq), Kind(WI_GlobalInits), GlobalInits(D), Function(nullptr), |
| 25 RawFunc(nullptr) {} |
| 26 EmitterWorkItem::EmitterWorkItem(uint32_t Seq, Assembler *A) |
| 27 : Sequence(Seq), Kind(WI_Asm), GlobalInits(nullptr), Function(A), |
| 28 RawFunc(nullptr) {} |
| 29 EmitterWorkItem::EmitterWorkItem(uint32_t Seq, Cfg *F) |
| 30 : Sequence(Seq), Kind(WI_Cfg), GlobalInits(nullptr), Function(nullptr), |
| 31 RawFunc(F) {} |
| 32 |
| 33 std::unique_ptr<VariableDeclarationList> EmitterWorkItem::getGlobalInits() { |
| 34 assert(getKind() == WI_GlobalInits); |
| 35 return std::move(GlobalInits); |
| 36 } |
| 37 |
| 38 std::unique_ptr<Assembler> EmitterWorkItem::getAsm() { |
| 39 assert(getKind() == WI_Asm); |
| 40 return std::move(Function); |
| 41 } |
| 42 |
| 43 std::unique_ptr<Cfg> EmitterWorkItem::getCfg() { |
| 44 assert(getKind() == WI_Cfg); |
| 45 return std::move(RawFunc); |
| 46 } |
| 47 |
| 48 } // end of namespace Ice |
OLD | NEW |