[llvm] [Support] Remove an unnecessary cast (NFC) (PR #146810)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 18:48:22 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/146810

We don't need to cast std::string to std::string.


>From b4ca51d79d6ea223135cc4e2bc60c7ce392ea530 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 2 Jul 2025 09:35:12 -0700
Subject: [PATCH] [Support] Remove an unnecessary cast (NFC)

We don't need to cast std::string to std::string.
---
 llvm/lib/Support/Signals.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp
index 59288e97cb24e..f8a14a45ddc3e 100644
--- a/llvm/lib/Support/Signals.cpp
+++ b/llvm/lib/Support/Signals.cpp
@@ -277,7 +277,7 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace,
   // If we don't know argv0 or the address of main() at this point, try
   // to guess it anyway (it's possible on some platforms).
   std::string MainExecutableName =
-      sys::fs::exists(Argv0) ? (std::string)std::string(Argv0)
+      sys::fs::exists(Argv0) ? std::string(Argv0)
                              : sys::fs::getMainExecutable(nullptr, nullptr);
 
   auto SymbolizedAddressesOpt = collectAddressSymbols(



More information about the llvm-commits mailing list