ErrorHandling.cpp (321369) | ErrorHandling.cpp (321723) |
---|---|
1//===- lib/Support/ErrorHandling.cpp - Callbacks for errors ---------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 155 unchanged lines hidden (view full) --- 164 165#ifdef LLVM_ENABLE_EXCEPTIONS 166 // If exceptions are enabled, make OOM in malloc look like OOM in new. 167 throw std::bad_alloc(); 168#else 169 // Don't call the normal error handler. It may allocate memory. Directly write 170 // an OOM to stderr and abort. 171 char OOMMessage[] = "LLVM ERROR: out of memory\n"; | 1//===- lib/Support/ErrorHandling.cpp - Callbacks for errors ---------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 155 unchanged lines hidden (view full) --- 164 165#ifdef LLVM_ENABLE_EXCEPTIONS 166 // If exceptions are enabled, make OOM in malloc look like OOM in new. 167 throw std::bad_alloc(); 168#else 169 // Don't call the normal error handler. It may allocate memory. Directly write 170 // an OOM to stderr and abort. 171 char OOMMessage[] = "LLVM ERROR: out of memory\n"; |
172 (void)::write(2, OOMMessage, strlen(OOMMessage)); | 172 ssize_t written = ::write(2, OOMMessage, strlen(OOMMessage)); 173 (void)written; |
173 abort(); 174#endif 175} 176 177void llvm::llvm_unreachable_internal(const char *msg, const char *file, 178 unsigned line) { 179 // This code intentionally doesn't call the ErrorHandler callback, because 180 // llvm_unreachable is intended to be used to indicate "impossible" --- 97 unchanged lines hidden --- | 174 abort(); 175#endif 176} 177 178void llvm::llvm_unreachable_internal(const char *msg, const char *file, 179 unsigned line) { 180 // This code intentionally doesn't call the ErrorHandler callback, because 181 // llvm_unreachable is intended to be used to indicate "impossible" --- 97 unchanged lines hidden --- |