LLVM Project News and Details from the Trenches

Friday, October 11, 2013

New libunwind implementation in libc++abi

Today we are happy to announce that the LLVM family of C++ support libraries is more complete than ever. To enable clang++ to port to platforms that do not have a system unwinder, Apple has contributed their unwinder implementation to LLVM. It is now dual licensed under LLVM and MIT license which is the same license as the rest of LLVM’s runtime support libraries.

The new unwinder has been added to the libcxxabi.llvm.org project.  The unwinder has two levels of API.  The high level APIs are the _Unwind_* functions which the cxa_* exception functions in libcxxabi require.  The low level APIs are the unw_* functions which are an interface defined by the the old HP libunwind project (which shares no code with this libunwind).

Most architectures now use "zero cost" exceptions for C++.   The zero cost means there are no extra instructions executed if no exceptions are thrown.  But if an exception is thrown, the runtime must consult side tables and figure out how to restore registers and "unwind" from the current stack frame to the catch clause.  That ability to modify the stack frames and cause the thread to resume in a catch clause with all registers restored properly is the main purpose of libunwind.

The new unwinder sources are known to build on Darwin, but will need some #defines configured to build on other platforms (patches welcome!).   The low level libunwind API was designed to work either in-process (aka local) or to operate on another process (aka remote), but only the local path has been completed, as that is all that C++ exceptions require.

-Nick Kledzik

Tuesday, October 8, 2013

OpenMP* project

I am extremely glad to announce that Intel has decided to provide a copy of our Intel® open-source OpenMP* runtime as an LLVM sub-project (and the LLVM project has been kind enough to accept our contribution!). This gives the community a fully LLVM license compatible version of the OpenMP runtime for use in  OpenMP development projects. The complete source code is now available at openmp.llvm.org

We open-sourced the Intel OpenMP runtime code to support the development of a full LLVM-based implementation of the OpenMP specification. Intel’s compiler team in Moscow has made outstanding progress in implementing the Clang changes to support the OpenMP language extensions (you can see their work at http://clang-omp.github.io), and now we’ve reached a milestone where we can create an LLVM sub-project for some of the other components that are needed to build a complete OpenMP system.

Personally, I am very happy (and proud) to be associated with LLVM, and I look forward to a long and productive collaboration.

-- Jim Cownie