diff options
Diffstat (limited to 'llvm/lib/Support/Unix/Signals.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 5de3a25476b..e8f4643dc8a 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -328,9 +328,11 @@ static bool printSymbolizedStackTrace(void **StackTrace, int Depth, FILE *FD) { // FIXME: Subtract necessary number from StackTrace entries to turn return addresses // into actual instruction addresses. // Use llvm-symbolizer tool to symbolize the stack traces. - std::string LLVMSymbolizerPath = sys::FindProgramByName("llvm-symbolizer"); - if (LLVMSymbolizerPath.empty()) + ErrorOr<std::string> LLVMSymbolizerPathOrErr = + sys::findProgramByName("llvm-symbolizer"); + if (!LLVMSymbolizerPathOrErr) return false; + const std::string &LLVMSymbolizerPath = *LLVMSymbolizerPathOrErr; // We don't know argv0 or the address of main() at this point, but try // to guess it anyway (it's possible on some platforms). std::string MainExecutableName = sys::fs::getMainExecutable(nullptr, nullptr); |