@@ -731,6 +731,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
731
731
}
732
732
}
733
733
734
+ /// A result produced by the backend.
734
735
pub ( crate ) enum WorkItemResult < B : WriteBackendMethods > {
735
736
Compiled ( CompiledModule ) ,
736
737
NeedsLink ( ModuleCodegen < B :: Module > ) ,
@@ -923,21 +924,34 @@ fn finish_intra_module_work<B: ExtraBackendMethods>(
923
924
}
924
925
}
925
926
927
+ /// Messages sent to the coordinator.
926
928
pub ( crate ) enum Message < B : WriteBackendMethods > {
929
+ /// A jobserver token has become available. Sent from the jobserver helper
930
+ /// thread.
927
931
Token ( io:: Result < Acquired > ) ,
928
- WorkItem {
929
- result : Result < WorkItemResult < B > , Option < WorkerFatalError > > ,
930
- worker_id : usize ,
931
- } ,
932
- CodegenDone {
933
- llvm_work_item : WorkItem < B > ,
934
- cost : u64 ,
935
- } ,
932
+
933
+ /// The backend has finished processing a work item for a codegen unit.
934
+ /// Sent from a backend worker thread.
935
+ WorkItem { result : Result < WorkItemResult < B > , Option < WorkerFatalError > > , worker_id : usize } ,
936
+
937
+ /// The frontend has finished generating something (backend IR or a
938
+ /// post-LTO artifact) for a codegen unit, and it should be passed to the
939
+ /// backend. Sent from the main thread.
940
+ CodegenDone { llvm_work_item : WorkItem < B > , cost : u64 } ,
941
+
942
+ /// Similar to `CodegenDone`, but for reusing a pre-LTO artifact
943
+ /// Sent from the main thread.
936
944
AddImportOnlyModule {
937
945
module_data : SerializedModule < B :: ModuleBuffer > ,
938
946
work_product : WorkProduct ,
939
947
} ,
948
+
949
+ /// The frontend has finished generating everything for all codegen units.
950
+ /// Sent from the main thread.
940
951
CodegenComplete ,
952
+
953
+ /// Some normal-ish compiler error occurred, and codegen should be wound
954
+ /// down. Sent from the main thread.
941
955
CodegenAborted ,
942
956
}
943
957
0 commit comments