[clang] [clang-repl] Honor `-emit-llvm` to print incremental IR (PR #217870)

Aaron Jomy via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 12:05:28 PDT 2026


================
@@ -361,8 +367,19 @@ int main(int argc, const char **argv) {
 
   bool HasError = false;
 
+  auto ProcessInput = [&](llvm::StringRef Input) -> llvm::Error {
+    if (!EmitLLVMIR)
+      return Interp->ParseAndExecute(Input);
+    auto PTU = Interp->Parse(Input);
+    if (!PTU)
+      return PTU.takeError();
+    if (PTU->TheModule)
+      PTU->TheModule->print(llvm::outs(), /*AAW=*/nullptr);
----------------
aaronj0 wrote:

I've tried implementing that in the follow up commit, is that what you had in mind?

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


More information about the cfe-commits mailing list