Index: src/IceThreading.cpp |
diff --git a/src/IceThreading.cpp b/src/IceThreading.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5576abb2ded87b45f432e446ca5703b6ce7fdafc |
--- /dev/null |
+++ b/src/IceThreading.cpp |
@@ -0,0 +1,48 @@ |
+//===- subzero/src/IceThreading.cpp - Threading function definitions ------===// |
+// |
+// The Subzero Code Generator |
+// |
+// This file is distributed under the University of Illinois Open Source |
+// License. See LICENSE.TXT for details. |
+// |
+//===----------------------------------------------------------------------===// |
+// |
+// This file defines threading-related functions. |
+// |
+//===----------------------------------------------------------------------===// |
+ |
+#include "IceCfg.h" |
+#include "IceDefs.h" |
+#include "IceThreading.h" |
+ |
+namespace Ice { |
+ |
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq) |
+ : Sequence(Seq), Kind(WI_Nop), GlobalInits(nullptr), Function(nullptr), |
+ RawFunc(nullptr) {} |
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq, VariableDeclarationList *D) |
+ : Sequence(Seq), Kind(WI_GlobalInits), GlobalInits(D), Function(nullptr), |
+ RawFunc(nullptr) {} |
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq, Assembler *A) |
+ : Sequence(Seq), Kind(WI_Asm), GlobalInits(nullptr), Function(A), |
+ RawFunc(nullptr) {} |
+EmitterWorkItem::EmitterWorkItem(uint32_t Seq, Cfg *F) |
+ : Sequence(Seq), Kind(WI_Cfg), GlobalInits(nullptr), Function(nullptr), |
+ RawFunc(F) {} |
+ |
+std::unique_ptr<VariableDeclarationList> EmitterWorkItem::getGlobalInits() { |
+ assert(getKind() == WI_GlobalInits); |
+ return std::move(GlobalInits); |
+} |
+ |
+std::unique_ptr<Assembler> EmitterWorkItem::getAsm() { |
+ assert(getKind() == WI_Asm); |
+ return std::move(Function); |
+} |
+ |
+std::unique_ptr<Cfg> EmitterWorkItem::getCfg() { |
+ assert(getKind() == WI_Cfg); |
+ return std::move(RawFunc); |
+} |
+ |
+} // end of namespace Ice |