[cfe-dev] Clang 3.5 Release Pre-Pre-Pre-Announcement

Alp Toker alp at nuanti.com
Sun May 18 18:19:13 PDT 2014


On 19/05/2014 02:10, Rafael EspĂ­ndola wrote:
>> Rafael and I were discussing something like in person recently. Rafael, can
>> you think of a way the LTO machinery could assist in determining DLL imports
>> and exports at build time?
> I don't think it is LTO specific. We could write a mode for LLD where
> it figures out exports automatically on COFF, but we should probably
> not depend on that for building a release.
>
> I think I am with Nico on this one. Building with -fvisibility-hidden
> would probably be a good thing for LLVM anyway. Once we have that then
> hopefully windows dll builds would not be too hard.

I don't think maintaining import/export annotations in the source code 
is viable in LLVM.

We'd be looking at hundreds of macros like EXPORT_IF_HAVE_CLANG and 
IMPORT_IF_MODULAR_BUILD, EXPORT_IF_NOT_MONOLITHIC_LLVMCLANG attached to 
functions and classes throughout LLVM. Yuck :-(

Excessive exports would prevent optimisations and inlining without any 
clear way to prune them as the code changes. LTO would have to export 
all these functions just in case something might be using them.

The only way to detect when new exports are needed would be to observe 
build bot breakage and add them incrementally until the bots turn green. 
Or to keep a shared build matching the DLL configuration.

It's really burdensome to have to modify the original *definition* every 
time you want to use a class or function. You'll no longer be able to 
develop and test a local clang branch against upstream LLVM, which will 
discourage people from developing against ToT.

And finally, the risk of breaking the build will be high enough to tip 
the balance in favour of copy-and-pasting the necessary code from LLVM 
core into clang in order to use it. It's not like we don't already have 
a copy-and-paste problem and this would legitimise the practice.

TLDR; We _really_ want to calculate these dependencies at build time 
with LLVMBuild instead of annotating the source.

Alp.


>
> Cheers,
> Rafael

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




More information about the cfe-dev mailing list