Skip to content

Revert unintended CompileError API change; track follow-up in issue#58

Merged
Robertkq merged 3 commits into
mainfrom
Robertkq/even_more_docs
May 28, 2026
Merged

Revert unintended CompileError API change; track follow-up in issue#58
Robertkq merged 3 commits into
mainfrom
Robertkq/even_more_docs

Conversation

@Robertkq

@Robertkq Robertkq commented May 28, 2026

Copy link
Copy Markdown
Owner

This updates the PR scope to match the request: no functional/compiler behavior changes in this PR, only documentation.
The previously added CompileError accessor/formatter change was reverted, and the broader error-location cleanup was moved to a dedicated issue.

  • Scope correction

    • Reverted commit that modified include/error.h (CompileError::message() / format() behavior), so this PR no longer carries runtime/compiler API changes.
  • Follow-up tracking

    • Opened a dedicated issue to audit CompileError construction sites and enforce structured line/column propagation across parser/lexer/compiler paths.
  • Reverted code (illustrative)

    // restored API shape in include/error.h
    const std::string &message() const { return _message; }
    std::string format() const { return std::format("[line {}:{}] CompilerError: {}", _line, _column, _message); }

@Robertkq Robertkq self-assigned this May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds/expands Doxygen documentation across the Picceler compiler and runtime, aligning with issue #51’s goal of improving in-source docs for key compiler components (passes, MLIR generation helpers, and public headers).

Changes:

  • Added Doxygen blocks for multiple MLIR lowering passes and the pass manager implementation.
  • Documented MLIRGen helpers (notably coerceValueToInt64) and several public headers (compiler.h, pass_manager.h, passes.h, dialect.h, types.h, etc.).
  • Added initial documentation for the runtime image API (lib/include/image.h).

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/picceler_to_llvm_ir_pass.cpp Adds a Doxygen brief for the LLVM IR lowering pass.
src/picceler_to_affine_pass.cpp Adds detailed Doxygen describing Picceler→Affine lowering.
src/picceler_ops_to_func_calls_pass.cpp Adds Doxygen brief for lowering runtime-like ops to function calls.
src/picceler_kernel_to_memref_pass.cpp Documents the KernelConstOp→MemRef lowering pass.
src/picceler_filters_to_conv_pass.cpp Documents filter→convolution lowering pass.
src/pass_manager.cpp Adds a file-level @file / @brief block for pass manager implementation.
src/mlir_gen.cpp Documents coerceValueToInt64 and MLIRGen::generate.
lib/include/image.h Adds docs for Image, loadImage, saveImage, showImage.
include/types.h Adds file header documentation for generated type includes.
include/passes.h Adds a Doxygen group for pass factory functions.
include/pass_manager.h Adds Doxygen for PassLogger and pass pipeline phase helpers.
include/ops.h Documents createFloatConstant and adds namespace closing comment.
include/image_access_helper.h Adds parameter/return docs for struct layout and accessors.
include/error.h Adds docs but also changes CompileError API/behavior (see comments).
include/dialect.h Adds file header documentation for generated dialect includes.
include/compiler.h Adds docs for CLI options and internal compiler steps (registry/object/link).
Comments suppressed due to low confidence (1)

src/mlir_gen.cpp:33

  • coerceValueToInt64 was previously scoped to an anonymous namespace (internal linkage) but is now a non-static function in namespace picceler, giving it external linkage from this translation unit. Since it’s a local helper not declared in a header, consider moving it back into an unnamed namespace or marking it static to avoid exporting an unnecessary symbol and reduce risk of name collisions.
namespace picceler {

/**
 * @brief Coerces a given MLIR value to a 64-bit integer if possible, with special handling for constants.
 * @param builder The MLIR OpBuilder to use for creating new operations if coercion is needed.
 * @param loc The location to use for any new operations created during coercion.
 * @param value The MLIR value to coerce.
 * @param opName The name of the operation for error reporting purposes.
 * @param argName The name of the argument for error reporting purposes.
 * @return The coerced MLIR value as a 64-bit integer.
 * @throws std::runtime_error if the value cannot be coerced to a 64-bit integer, or if a floating-point constant is not
 * a whole number or is out of range.
 */

mlir::Value coerceValueToInt64(mlir::OpBuilder &builder, mlir::Location loc, mlir::Value value, llvm::StringRef opName,
                               llvm::StringRef argName) {
  if (value.getType().isSignlessInteger(64)) {
    return value;
  }

Comment thread include/error.h
Comment thread lib/include/image.h
@Robertkq Robertkq force-pushed the Robertkq/even_more_docs branch from 29d868b to 863ad2f Compare May 28, 2026 10:34
Copilot AI changed the title More documentation Revert unintended CompileError API change; track follow-up in issue May 28, 2026
@Robertkq Robertkq merged commit b415ee7 into main May 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants