On Apr 14, 2013, at 5:32 PM, Rafael Espíndola <[email protected]> 
wrote:
> With the attached patch I can bootstrap clang on my new ARM chromebook
> running fedora 18.
> 
> The thing is, I don't really understand what this code is doing :-(
> 
> Why is clang in the business of deciding what gets compiled into a
> libgcc/compilerrt call? Shouldn't it always produce IL that uses the
> atomic operations and let LLVM produce the compiler-rt calls when it
> knows the backend can't handle it?

The use of a library function is ABI and therefore a natural frontend 
responsibility.
Among other things:
  - the atomic library functions are not guaranteed to be atomic w.r.t. the 
processor's
    primitive atomics and
  - different targets may require us to use a different set of atomic library 
functions
    or provide slightly different semantics to them.

So it makes sense for the backend to require that the frontend just not emit
illegal primitive atomic operations.

The current design where atomic library routines are statically linked in from
compiler-rt allows us to compile things we wouldn't otherwise but is extremely
problematic for library interoperation.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to