Can we make libcxx headers more modular for faster compilation?

Hi Yaron

I think there is a need to do some work on libcxx’s modularity / layering, but I wouldn’t focus on doing it for speed purposes myself.

I think it needs a look at more for correctness and porting issues than anything else.

I suspect (and I may be wrong) that you are basing some of your libcxx’s modularity thoughts on the Windows port?

The Windows port is still in a bit of a hacked state. libcxx on Apple/Linux is not.

You might want check your modularity thoughts on apple/Linux to get something more representative of the real libcxx? If you think there is real modularity issues in the apple/Linux version I’d be more surprised.

I have been thinking about this problem and have some ideas to reduce and refactor the windows include situation now I understand it a little better.
There’s two or 3 places where we can improve the situation for Windows. But again in my mind the emphasis is more on correctness and layering than speed.

Once my outstanding patches are committed I’ll fix some of this up.

Hi Howard,

I’m a no expert on library design… the motivaton for message (I should have detailed to make it clearer) come from a user’s perspective:

I noticed both clang and gcc compile a trivial program three times slower when including iostream from libcxx compared with including iostream from stdlibc++ . I checked all combinations, posted full details in my previous message.

The version I’m using the the latest obtained from the svn. I wasn’t aware there is a different windows port of it? anyhow, the latest svn compiles without special problems using clang from the builds site and the MingW 4.8.1 C library and header files. I also built the required libcxxabi. the build seems to work but I have not tested it yet, especially if exceptions work at all.

The changes I made in both builds were flags only, added
-Wno-deprecated-register -Wno-ignored-attributes to avoid warnings on MingW headers, -target i686-pc-mingw32 since clang.exe was compiled on VC and assume this is the target, -nostdinc -Ilibcxxdirectory -Imingwincludedirectory to use the libcxx header files.

I did not submit a patch yet since it’s not clear to me what is the “official” way to build libcxx. There are both CMakeLists (which do not have the correct flags for compiling) and a buildit shell script. I used the shell script.

Yaron