Author: smeenai Date: Wed Oct 4 19:18:08 2017 New Revision: 314965 URL: http://llvm.org/viewvc/llvm-project?rev=314965&view=rev Log: [libc++] Clarify names of ABI forcing macros
Make it clear that these are intended only to force a specific ABI when the autodetection would give the wrong result by renaming the cmake options and adding separate forcing macros, as suggested by EricWF in the post-commit review of r314949 and further discussed on IRC. Modified: libcxx/trunk/CMakeLists.txt libcxx/trunk/include/__config libcxx/trunk/include/__config_site.in Modified: libcxx/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=314965&r1=314964&r2=314965&view=diff ============================================================================== --- libcxx/trunk/CMakeLists.txt (original) +++ libcxx/trunk/CMakeLists.txt Wed Oct 4 19:18:08 2017 @@ -99,8 +99,8 @@ cmake_dependent_option(LIBCXX_INSTALL_EX "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF) set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.") option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF) -option(LIBCXX_ABI_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.") -option(LIBCXX_ABI_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.") +option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.") +option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.") set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI macros to define in the site config header.") option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) @@ -340,8 +340,8 @@ if (LIBCXX_HAS_MUSL_LIBC AND NOT LIBCXX_ "when building for Musl with LIBCXX_HAS_MUSL_LIBC.") endif() -if (LIBCXX_ABI_ITANIUM AND LIBCXX_ABI_MICROSOFT) - message(FATAL_ERROR "Only one of LIBCXX_ABI_ITANIUM and LIBCXX_ABI_MICROSOFT can be specified.") +if (LIBCXX_ABI_FORCE_ITANIUM AND LIBCXX_ABI_FORCE_MICROSOFT) + message(FATAL_ERROR "Only one of LIBCXX_ABI_FORCE_ITANIUM and LIBCXX_ABI_FORCE_MICROSOFT can be specified.") endif () #=============================================================================== @@ -601,8 +601,8 @@ if (NOT LIBCXX_ABI_VERSION EQUAL "1") config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION) endif() config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE) -config_define_if(LIBCXX_ABI_ITANIUM _LIBCPP_ABI_ITANIUM) -config_define_if(LIBCXX_ABI_MICROSOFT _LIBCPP_ABI_MICROSOFT) +config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM) +config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT) config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN) Modified: libcxx/trunk/include/__config URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=314965&r1=314964&r2=314965&view=diff ============================================================================== --- libcxx/trunk/include/__config (original) +++ libcxx/trunk/include/__config Wed Oct 4 19:18:08 2017 @@ -160,7 +160,13 @@ // that Windows compilers pretending to be MSVC++ target the Microsoft ABI, // and allow the user to explicitly specify the ABI to handle cases where this // heuristic falls short. -#if !defined(_LIBCPP_ABI_ITANIUM) && !defined(_LIBCPP_ABI_MICROSOFT) +#if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT) +# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined" +#elif defined(_LIBCPP_ABI_FORCE_ITANIUM) +# define _LIBCPP_ABI_ITANIUM +#elif defined(_LIBCPP_ABI_FORCE_MICROSOFT) +# define _LIBCPP_ABI_MICROSOFT +#else # if defined(_WIN32) && defined(_MSC_VER) # define _LIBCPP_ABI_MICROSOFT # else Modified: libcxx/trunk/include/__config_site.in URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config_site.in?rev=314965&r1=314964&r2=314965&view=diff ============================================================================== --- libcxx/trunk/include/__config_site.in (original) +++ libcxx/trunk/include/__config_site.in Wed Oct 4 19:18:08 2017 @@ -12,8 +12,8 @@ #cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@ #cmakedefine _LIBCPP_ABI_UNSTABLE -#cmakedefine _LIBCPP_ABI_ITANIUM -#cmakedefine _LIBCPP_ABI_MICROSOFT +#cmakedefine _LIBCPP_ABI_FORCE_ITANIUM +#cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT #cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE #cmakedefine _LIBCPP_HAS_NO_STDIN #cmakedefine _LIBCPP_HAS_NO_STDOUT _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits