From 834df5290d2f4feb552bfc0359fd4b0c97f72b6c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 23 Apr 2018 10:26:33 -0700 Subject: [PATCH] Add more comments to module.rs. --- lib/module/src/module.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/module/src/module.rs b/lib/module/src/module.rs index b47189f1d9..f275dea575 100644 --- a/lib/module/src/module.rs +++ b/lib/module/src/module.rs @@ -79,18 +79,23 @@ enum FuncOrDataId { Data(DataId), } +/// Information about a function which can be called. pub struct FunctionDeclaration { pub name: String, pub linkage: Linkage, pub signature: ir::Signature, } +/// A function belonging to a `Module`. struct ModuleFunction where B: Backend, { + /// The function declaration. decl: FunctionDeclaration, + /// The compiled artifact, once it's available. compiled: Option, + /// A flag indicating whether the function has been finalized. finalized: bool, } @@ -103,18 +108,23 @@ where } } +/// Information about a data object which can be accessed. pub struct DataDeclaration { pub name: String, pub linkage: Linkage, pub writable: bool, } +/// A data object belonging to a `Module`. struct ModuleData where B: Backend, { + /// The data object declaration. decl: DataDeclaration, + /// The "compiled" artifact, once it's available. compiled: Option, + /// A flag indicating whether the data object has been finalized. finalized: bool, } @@ -128,6 +138,7 @@ where } } +/// The functions and data objects belonging to a module. struct ModuleContents where B: Backend,