[cfe-commits] r146641 - /cfe/trunk/tools/libclang/CIndex.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Dec 14 23:31:13 PST 2011
On Dec 14, 2011, at 9:43 PM, Eli Friedman wrote:
> On Wed, Dec 14, 2011 at 8:52 PM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
>> Author: akirtzidis
>> Date: Wed Dec 14 22:52:41 2011
>> New Revision: 146641
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=146641&view=rev
>> Log:
>> [libclang] Install a fatal error handler that will call abort() instead of exit()
>> when there is a report_fatal_error() call.
>>
>> rdar://10507984
>>
>> Modified:
>> cfe/trunk/tools/libclang/CIndex.cpp
>>
>> Modified: cfe/trunk/tools/libclang/CIndex.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=146641&r1=146640&r2=146641&view=diff
>> ==============================================================================
>> --- cfe/trunk/tools/libclang/CIndex.cpp (original)
>> +++ cfe/trunk/tools/libclang/CIndex.cpp Wed Dec 14 22:52:41 2011
>> @@ -2336,6 +2336,17 @@
>> static llvm::sys::Mutex EnableMultithreadingMutex;
>> static bool EnabledMultithreading;
>>
>> +static void fatal_error_handler(void *user_data, const std::string& reason) {
>> + llvm::SmallString<64> Buffer;
>> + llvm::raw_svector_ostream OS(Buffer);
>> + OS << "LIBCLANG FATAL ERROR: " << reason << "\n";
>> + StringRef MessageStr = OS.str();
>> + // Write the result out to stderr avoiding errs() because raw_ostreams can
>> + // call report_fatal_error.
>> + ::write(2, MessageStr.data(), MessageStr.size());
>
> There's at least one buildbot complaining it can't find ::write.
> http://lab.llvm.org:8011/builders/clang-x86_64-darwin11-self-mingw32/builds/84/steps/compile/logs/stdio
> etc.
Fixed on r146648
>
> -Eli
More information about the cfe-commits
mailing list