llvm.org GIT mirror llvm / c1303e8
Remove useless and unused CrashRecoveryContext::getBacktrace(). This function always returned an empty string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264458 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Smith 4 years ago
2 changed file(s) with 1 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
6969 /// \return True if the function completed successfully, and false if the
7070 /// function crashed (or HandleCrash was called explicitly). Clients should
7171 /// make as little assumptions as possible about the program state when
72 /// RunSafely has returned false. Clients can use getBacktrace() to retrieve
73 /// the backtrace of the crash on failures.
72 /// RunSafely has returned false.
7473 bool RunSafely(function_ref Fn);
7574 bool RunSafely(void (*Fn)(void*), void *UserData) {
7675 return RunSafely([&]() { Fn(UserData); });
9392 /// \brief Explicitly trigger a crash recovery in the current process, and
9493 /// return failure from RunSafely(). This function does not return.
9594 void HandleCrash();
96
97 /// \brief Return a string containing the backtrace where the crash was
98 /// detected; or empty if the backtrace wasn't recovered.
99 ///
100 /// This function is only valid when a crash has been detected (i.e.,
101 /// RunSafely() has returned false.
102 const std::string &getBacktrace() const;
10395 };
10496
10597 class CrashRecoveryContextCleanup {
3030 const CrashRecoveryContextImpl *Next;
3131
3232 CrashRecoveryContext *CRC;
33 std::string Backtrace;
3433 ::jmp_buf JumpBuffer;
3534 volatile unsigned Failed : 1;
3635 unsigned SwitchedThread : 1;
334333 CRCI->HandleCrash();
335334 }
336335
337 const std::string &CrashRecoveryContext::getBacktrace() const {
338 CrashRecoveryContextImpl *CRC = (CrashRecoveryContextImpl *) Impl;
339 assert(CRC && "Crash recovery context never initialized!");
340 assert(CRC->Failed && "No crash was detected!");
341 return CRC->Backtrace;
342 }
343
344336 // FIXME: Portability.
345337 static void setThreadBackgroundPriority() {
346338 #ifdef __APPLE__