From 769cc3dfec46cdc2f1dcac7d5ce438d2e4948aed Mon Sep 17 00:00:00 2001 From: jeaye Date: Tue, 1 Apr 2025 13:40:23 -0700 Subject: [PATCH] Return pointer to non-const for getExecutionEngine 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? --- lib/Interpreter/CppInterOpInterpreter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Interpreter/CppInterOpInterpreter.h b/lib/Interpreter/CppInterOpInterpreter.h index b5b8e7e96..cdac4f768 100644 --- a/lib/Interpreter/CppInterOpInterpreter.h +++ b/lib/Interpreter/CppInterOpInterpreter.h @@ -167,7 +167,7 @@ class Interpreter { return inner->getCompilerInstance(); } - const llvm::orc::LLJIT* getExecutionEngine() const { + llvm::orc::LLJIT* getExecutionEngine() const { return compat::getExecutionEngine(*inner); }