Skip to content
  • dmp's avatar
    Hide STG register declarations for LLVM C compilers · f542da48
    dmp authored and Simon Marlow's avatar Simon Marlow committed
    This commit swaps the import order of Rts.h and Stg.h in
    StgCRun.c for non-SPARC architectures. Swapping the import
    order prevents the declaration of the global registers thus
    allowing the GHC runtime to be compiled by LLVM-based C
    compilers.
    
    LLVM-base C compilers cannot use the global register
    declarations (for R1, R2, etc.) because they use
    GCC-specific extensions. The declarations are not needed in
    StgCRun.c except for the SPARC architecture. The other
    architectures use hand-written assembly that accesses the
    appropriate register directly.
    f542da48