From: Chad Rosier Date: Mon, 12 Nov 2012 19:39:37 +0000 (+0000) Subject: If we encounter a fatal error, call the interrupt handler to ensure any X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ea7397ebcd46447668236d64acd6f6ffd550042;p=platform%2Fupstream%2Fllvm.git If we encounter a fatal error, call the interrupt handler to ensure any temporary files are removed. rdar://12282296 llvm-svn: 167741 --- diff --git a/clang/tools/driver/cc1_main.cpp b/clang/tools/driver/cc1_main.cpp index f196856..674f2ad 100644 --- a/clang/tools/driver/cc1_main.cpp +++ b/clang/tools/driver/cc1_main.cpp @@ -27,6 +27,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/Signals.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" @@ -43,6 +44,10 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message) { Diags.Report(diag::err_fe_error_backend) << Message; + // Run the interrupt handlers to make sure any special cleanups get done, in + // particular that we remove files registered with RemoveFileOnSignal. + llvm::sys::RunInterruptHandlers(); + // We cannot recover from llvm errors. exit(1); }