[clang] 2b873f0 - Revert "[clang-repl] Honor `-emit-llvm` to print incremental IR" (#218118)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 22 04:26:40 PDT 2026
Author: Vassil Vassilev
Date: 2026-08-22T11:26:35Z
New Revision: 2b873f0fbbbe7c4732e488646756731be0bed2f6
URL: https://github.com/llvm/llvm-project/commit/2b873f0fbbbe7c4732e488646756731be0bed2f6
DIFF: https://github.com/llvm/llvm-project/commit/2b873f0fbbbe7c4732e488646756731be0bed2f6.diff
LOG: Revert "[clang-repl] Honor `-emit-llvm` to print incremental IR" (#218118)
Reverts llvm/llvm-project#217870
Added:
Modified:
clang/lib/Interpreter/IncrementalAction.cpp
clang/lib/Interpreter/Interpreter.cpp
Removed:
clang/test/Interpreter/emit-llvm.cpp
################################################################################
diff --git a/clang/lib/Interpreter/IncrementalAction.cpp b/clang/lib/Interpreter/IncrementalAction.cpp
index 85f00c36dd5aa..d22031c8fa893 100644
--- a/clang/lib/Interpreter/IncrementalAction.cpp
+++ b/clang/lib/Interpreter/IncrementalAction.cpp
@@ -47,7 +47,6 @@ IncrementalAction::IncrementalAction(CompilerInstance &Instance,
case frontend::EmitBC:
case frontend::EmitObj:
case frontend::PrintPreprocessedInput:
- case frontend::EmitLLVM:
case frontend::EmitLLVMOnly:
Act.reset(new EmitLLVMOnlyAction(&LLVMCtx));
break;
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index c9b127a360e5d..0536fdcd548a2 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -31,7 +31,6 @@
#include "clang/Driver/Tool.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
-#include "clang/Frontend/FrontendOptions.h"
#include "clang/Frontend/MultiplexConsumer.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/FrontendTool/Utils.h"
@@ -569,12 +568,6 @@ Interpreter::Parse(llvm::StringRef Code) {
PartialTranslationUnit &LastPTU = IncrParser->RegisterPTU(*TuOrErr);
- // Under -emit-llvm, print the module IR.
- if (InitPTUSize && LastPTU.TheModule &&
- getCompilerInstance()->getFrontendOpts().ProgramAction ==
- frontend::EmitLLVM)
- LastPTU.TheModule->print(llvm::outs(), /*AAW=*/nullptr);
-
return LastPTU;
}
diff --git a/clang/test/Interpreter/emit-llvm.cpp b/clang/test/Interpreter/emit-llvm.cpp
deleted file mode 100644
index 96f18a6d0d34d..0000000000000
--- a/clang/test/Interpreter/emit-llvm.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// REQUIRES: host-supports-jit
-//
-// -emit-llvm prints the IR of each input before running them.
-//
-// RUN: cat %s | clang-repl -Xcc -Xclang -Xcc -emit-llvm | FileCheck %s
-
-extern "C" int add(int a, int b) { return a + b; }
-// CHECK: define {{.*}}i32 @add(
-// CHECK: ret i32
-
-extern "C" int answer = 42;
-// CHECK: @answer = {{.*}}i32 42
-
-extern "C" int neg(int a) { return -a; }
-// CHECK: define {{.*}}i32 @neg(
-
-extern "C" int r = add(19, 23);
-// CHECK: @r = {{.*}}global i32
-// CHECK: call i32 @add(
-r
-// CHECK: (int) 42
More information about the cfe-commits
mailing list