[clang] [clang-repl][CodeGen] Add setOptLevel, #pragma clang repl optimize(N) (PR #214793)

Aaron Jomy via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 15:24:10 PDT 2026


================
@@ -402,6 +484,8 @@ Interpreter::Interpreter(std::unique_ptr<CompilerInstance> Instance,
 }
 
 Interpreter::~Interpreter() {
+  if (ReplPragma)
----------------
aaronj0 wrote:

That was only needed  when the constructor had returned on an error before registering it. That storage is no longer required: the handler is no longer a member so destruction does not need to be handled. The handler goes to AddPragmaHandler with new, just as the Preprocessor registers its own '#pragma clang' handlers, so it is owned by PragmaNamespace  for the life of the CompilerInstance. 

https://github.com/llvm/llvm-project/pull/214793


More information about the cfe-commits mailing list