Skip to content

Conversation

@jeaye
Copy link
Contributor

@jeaye jeaye commented Apr 1, 2025

The clang::Interpreter wrapper previously returned a pointer to const, but the actual clang::Interpreter did not. This breaks code for anyone porting from clang::Interpreter to Cpp::Interpreter, especially since most operations on the execution engine are mutations of some sort.

Yes, the user could static cast the wrapper to the inner interpreter, but, at that point, why both exposing the getExecutionEngine function at all?

The `clang::Interpreter` wrapper previously returned a pointer to const,
but the actual `clang::Interpreter` did not. This breaks code for anyone
porting from `clang::Interpreter` to `Cpp::Interpreter`, especially
since most operations on the execution engine are mutations of some
sort.

Yes, the user could static cast the wrapper to the inner interpreter,
but, at that point, why both exposing the `getExecutionEngine` function
at all?
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

}

const llvm::orc::LLJIT* getExecutionEngine() const {
llvm::orc::LLJIT* getExecutionEngine() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'getExecutionEngine' should be marked [[nodiscard]] [modernize-use-nodiscard]

Suggested change
llvm::orc::LLJIT* getExecutionEngine() const {
[[nodiscard]] llvm::orc::LLJIT* getExecutionEngine() const {

@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.94%. Comparing base (e1ace51) to head (769cc3d).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #547   +/-   ##
=======================================
  Coverage   75.94%   75.94%           
=======================================
  Files           9        9           
  Lines        3646     3646           
=======================================
  Hits         2769     2769           
  Misses        877      877           
Files with missing lines Coverage Δ
lib/Interpreter/CppInterOpInterpreter.h 80.32% <ø> (ø)
Files with missing lines Coverage Δ
lib/Interpreter/CppInterOpInterpreter.h 80.32% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Lgtm!

@vgvassilev vgvassilev merged commit 86cbd02 into compiler-research:main Apr 8, 2025
144 of 162 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.

2 participants