[llvm] [Support] Remove an unnecessary cast (NFC) (PR #146810)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 2 18:48:52 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
We don't need to cast std::string to std::string.
---
Full diff: https://github.com/llvm/llvm-project/pull/146810.diff
1 Files Affected:
- (modified) llvm/lib/Support/Signals.cpp (+1-1)
``````````diff
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(
``````````
</details>
https://github.com/llvm/llvm-project/pull/146810
More information about the llvm-commits
mailing list