[libcxx] r291329 - Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 7 00:29:05 PST 2017


Do you think it's worth also checking for the presence of cxxabi.h and
assuming the Itanium ABI if it's found, since the MS ABI shouldn't be using
any ABI library?

(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY would have been ideal were it available
persistently rather than only during the build of libc++ itself. It could
still work if this macro isn't used in any headers though.)

Also, is there ever a case where _MSC_VER would be defined and _WIN32
wouldn't? The current check seems slightly redundant.

On 1/6/17, 6:43 PM, "cfe-commits on behalf of Eric Fiselier via cfe-commits" <cfe-commits-bounces at lists.llvm.org on behalf of cfe-commits at lists.llvm.org> wrote:

    Author: ericwf
    Date: Fri Jan  6 20:43:58 2017
    New Revision: 291329
    
    URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D291329-26view-3Drev&d=DgIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=vt8N_ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c&s=fVFRdDSSgXSZHuGlbfQI1SHyPLDGvuVdhQdxOsU30hI&e= 
    Log:
    Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.
    
    This patch adds a libc++ configuration macro for the ABI we
    are targeting, either Itanium or Microsoft. For now we configure
    for the Microsoft ABI when on Windows with a compiler that defines
    _MSC_VER. However this is only temporary until Clang implements
    builtin macros we can use.
    
    Modified:
        libcxx/trunk/include/__config
    
    Modified: libcxx/trunk/include/__config
    URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_include_-5F-5Fconfig-3Frev-3D291329-26r1-3D291328-26r2-3D291329-26view-3Ddiff&d=DgIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=vt8N_ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c&s=46ge62wLL0LHhhQmWVsvb0uPoh8oV44DG0fsq0nEPs8&e= 
    ==============================================================================
    --- libcxx/trunk/include/__config (original)
    +++ libcxx/trunk/include/__config Fri Jan  6 20:43:58 2017
    @@ -111,6 +111,15 @@
     #define _LIBCPP_COMPILER_IBM
     #endif
     
    +// FIXME: ABI detection should be done via compiler builtin macros. This
    +// is just a placeholder until Clang implements such macros. For now assume
    +// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
    +#if defined(_WIN32) && defined(_MSC_VER)
    +# define _LIBCPP_ABI_MICROSOFT
    +#else
    +# define _LIBCPP_ABI_ITANIUM
    +#endif
    +
     // Need to detect which libc we're using if we're on Linux.
     #if defined(__linux__)
     #include <features.h>
    
    
    _______________________________________________
    cfe-commits mailing list
    cfe-commits at lists.llvm.org
    https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dcommits&d=DgIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=vt8N_ZR6syyL2-CBgE_SBSS0YTQdKIMfcLf4r8leu2c&s=rzONjyM9TBpTpA9aQpIA9LFsaiofSZIYff34ZiNb5cA&e= 
    



More information about the cfe-commits mailing list