Does libcxxabi makes sense under linux? What are the benefits?

You should not use libcxxabi directly. To my understanding it is a kind of platform abstraction library, providing low level functions needed to implement libcxx. If you are asking about using libcxx or libstdc++, the differences are mostly the license, newer standard version completeness (the clang project seems slightly faster in implementing recent C++ revisions) …

Read more

Xcode 3.2.1 GCC CLANG and LLVM demystification

In a nutshell: Compilers are basically split into two parts. One being the front-end that contains the parser and semantic analysis for the programming language. The front-end produces some kind of intermediate representation of your code. Then there’s the backend which takes the stuff the front-end produced, optimizes it, and eventually generates assembly code. GCC: …

Read more

How does clang generate non-looping code for sum of squares?

TL:DR: Yes, clang knows the closed-form formulas for sums of integer power series, and can detect such loops. Smart humans have taught modern compilers to recognize certain patterns of operations and replace them with operations not present in the source, e.g. for rotates and even popcount loops and bithacks. And for clang/LLVM specifically, also closed-form …

Read more

Dynamic forwarding: suppress Incomplete Implementation warning

You can suppress Incomplete Implementation warnings by adding #pragma clang diagnostic ignored “-Wincomplete-implementation” just above the @implementation Hope this helps EDIT After being told in the comments that this didn’t work for someone and finding out the reason was because it was a different warning they were getting I have done a bit of playing …

Read more

Is it possible to transform LLVM bytecode into Java bytecode?

It does now appear possible to convert LLVM IR bytecode to Java bytecode, using the LLJVM interpreter. There is an interesting Disqus comment (21/03/11) from Grzegorz of kraytracing.com which explains, along with code, how he has modified LLJVM’s Java class output routine to emit non-monolithic Java classes which agree in number with the input C/C++ …

Read more

Out-of-Line Virtual Method

The compiler must emit a vtable for classes with virtual methods. This contains the pointers to these methods. If all the virtual methods are inline (defined in the header), then the compiler doesn’t know which translation unit (.cpp file) to emit the vtable within, so it emits a copy in all of them and the …

Read more