Skip to content

Commit

Permalink
some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Feb 13, 2024
1 parent 53e13ae commit 743702d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/concrete_codegen_mlir/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use melior::{
Context as MeliorContext,
};

/// Global codegen context
#[derive(Debug, Clone, Copy)]
pub(crate) struct CodegenCtx<'a> {
pub mlir_context: &'a MeliorContext,
Expand All @@ -23,6 +24,7 @@ pub(crate) struct CodegenCtx<'a> {
pub program: &'a ProgramBody,
}

/// Codegen context for a module
#[derive(Debug, Clone, Copy)]
struct ModuleCodegenCtx<'a> {
pub ctx: CodegenCtx<'a>,
Expand Down Expand Up @@ -59,7 +61,7 @@ impl<'a> ModuleCodegenCtx<'a> {
}
}

pub fn compile_program(ctx: CodegenCtx) -> Result<(), Box<dyn Error>> {
pub(crate) fn compile_program(ctx: CodegenCtx) -> Result<(), Box<dyn Error>> {
for module_id in &ctx.program.top_level_modules {
let ctx = ModuleCodegenCtx {
ctx,
Expand Down
2 changes: 1 addition & 1 deletion crates/concrete_codegen_mlir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub mod linker;
mod module;
mod pass_manager;

/// Returns the object file path.
/// Compiles the given program and returns the object file path.
pub fn compile(session: &Session, program: &ProgramBody) -> Result<PathBuf, Box<dyn Error>> {
let context = Context::new();
let compile_codegen_time = Instant::now();
Expand Down

0 comments on commit 743702d

Please sign in to comment.