[LLVMdev] [cfe-dev] Goal for 3.5: Library-friendly headers

Alp Toker alp at nuanti.com
Mon Nov 11 09:56:03 PST 2013


On 11/11/2013 07:37, NAKAMURA Takumi wrote:
> 2013/11/10 Alp Toker <alp at nuanti.com>:
>> #ifndef NDEBUG
>>
>> This is the biggest violation. NDEBUG should only ever be used in source
>> files. That way if something is crashing we can swap in a debug build
>> without rebuilding every single dependent application. Win!
> I wish;
>
>   - NDEBUG may not modify API. class structure (member offset, vtables)
>     should be stable and identical among Release builds and Debug builds.
>   - NDEBUG may keep and add facilities.

Done :-)

The patchset is 532K so I've put it online:

  http://www.nuanti.com/tmp/llvm-api-stability/

The bulk edits are split out and noted. They were refactored with an
internal tool, so it's not a big hassle to keep this up to date until
3.4 is out the door.

A handful of fixes were needed to add support for Release+Assert builds
and these are also separate commits.

TableGen and internal tools continue to use ordinary platform assert() /
NDEBUG (I think a few uses might have been incorrectly changed, will
check over), as do the C++ sources and non-public headers.

llvm_assert() is a bit more verbose but it actually fits into the coding
style well, and it's grown on me.

Extract from README.txt:

|This patchset against LLVM r194356 implements API stability.||
||
||Embedding is now fully independent of build configuration, with the
exception of C++11 feature checks in Compiler.h which still need to be
autoconf'ed.||
||
||External applications should include llvm-config.h. ||
||
||Only supported with the CMake build system, Makefile is TBD.|

Alp.

-- 
http://www.nuanti.com
the browser experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131111/7fe81855/attachment.html>


More information about the llvm-dev mailing list