[llvm-branch-commits] [clang] 93df843 - Revert "[clang-repl] Honor `-emit-llvm` to print incremental IR (#217870)"
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Aug 22 03:46:18 PDT 2026
Author: Vassil Vassilev
Date: 2026-08-22T13:46:14+03:00
New Revision: 93df84386f433b20ac6cb29ac33a2c4d56392725
URL: https://github.com/llvm/llvm-project/commit/93df84386f433b20ac6cb29ac33a2c4d56392725
DIFF: https://github.com/llvm/llvm-project/commit/93df84386f433b20ac6cb29ac33a2c4d56392725.diff
LOG: Revert "[clang-repl] Honor `-emit-llvm` to print incremental IR (#217870)"
This reverts commit 2a9b623c95d6ea9e13acefa2a24473b7b87dc238.
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 llvm-branch-commits
mailing list