[llvm] [llc][NFC] Remove unreachable return statement (PR #169915)

Tomer Shafir via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 28 05:09:16 PST 2025


https://github.com/tomershafir created https://github.com/llvm/llvm-project/pull/169915

`reportError()` is a `[[noreturn]]` that calls `exit(1)`.

>From 7ca261fe2e46b1fd2f3650a99acc67da24ea9a5c Mon Sep 17 00:00:00 2001
From: tomershafir <tomer.shafir8 at gmail.com>
Date: Fri, 28 Nov 2025 15:03:49 +0200
Subject: [PATCH] [llc][NFC] Remove unreachable return statement

`reportError()` is a `[[noreturn]]` that calls `exit(1)`.
---
 llvm/tools/llc/llc.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index ce1ce5d68c137..ad31a0ec63387 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -355,13 +355,11 @@ static std::unique_ptr<ToolOutputFile> GetOutputStream(Triple::OSType OS) {
   if (!Binary)
     OpenFlags |= sys::fs::OF_TextWithCRLF;
   auto FDOut = std::make_unique<ToolOutputFile>(OutputFilename, EC, OpenFlags);
-  if (EC) {
+  if (EC)
     reportError(EC.message());
-    return nullptr;
-  }
-
   return FDOut;
 }
+
 // main - Entry point for the llc compiler.
 //
 int main(int argc, char **argv) {



More information about the llvm-commits mailing list