[cfe-commits] [PATCH] [libcxx][locale] disable inlining of variadic functions in GCC

Howard Hinnant hhinnant at apple.com
Thu Dec 27 15:18:23 PST 2012


Continuing to want linux users to review/commit this.  It does not impact Apple systems (though if someone sees differently rattle my cage).

Thanks,
Howard

On Dec 27, 2012, at 5:58 PM, Saleem Abdulrasool <compnerd at compnerd.org> wrote:

>  _LIBCPP_ALWAYS_INLINE is now being dropped on both clang and GCC (on the latter only if GCC is <= 4.7.2 ... which means that we will need to update it if newer versions dont support it).
> 
>  Im unsure if doing something similar for clang would be a good idea or not (though, I feel that if we are doing it for GCC, we should also do it for clang).
> 
>  Im unsure of the behaviour of other compilers (MSVC?), so I decided to not unconditionally drop the _LIBCPP_ALWAYS_INLINE as per rsmith's suggestion.  However, if you feel strongly about it, I can always update the patch.
> 
> Hi Bigcheese,
> 
> http://llvm-reviews.chandlerc.com/D241
> 
> CHANGE SINCE LAST DIFF
>  http://llvm-reviews.chandlerc.com/D241?vs=587&id=601#toc
> 
> Files:
>  include/__config
>  include/locale
> 
> Index: include/__config
> ===================================================================
> --- include/__config
> +++ include/__config
> @@ -19,6 +19,14 @@
> #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
> #endif
> 
> +#if defined(__GNUC__)
> +#define __GNUC_VERSION(_major, _minor, _patch)                                  \
> +    ((_major << 16) + (_minor << 8) + (_patch << 0))
> +
> +#define __GNUC_VERSION_CODE                                                     \
> +    __GNUC_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
> +#endif
> +
> #define _LIBCPP_VERSION 1101
> 
> #define _LIBCPP_ABI_VERSION 1
> Index: include/locale
> ===================================================================
> --- include/locale
> +++ include/locale
> @@ -354,7 +354,10 @@
> #endif
> }
> 
> -_LIBCPP_ALWAYS_INLINE inline
> +#if !defined(__GNUC__) || (__GNUC_VERSION_CODE > __GNUC_VERSION(4, 7, 2))
> +_LIBCPP_ALWAYS_INLINE
> +#endif
> +inline
> int __sprintf_l(char *__s, locale_t __l, const char *__format, ...) {
>   va_list __va;
>   va_start(__va, __format);
> @@ -368,7 +371,10 @@
>   return __res;
> }
> 
> -_LIBCPP_ALWAYS_INLINE inline
> +#if !defined(__GNUC__) || (__GNUC_VERSION_CODE > __GNUC_VERSION(4, 7, 2))
> +_LIBCPP_ALWAYS_INLINE
> +#endif
> +inline
> int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
>   va_list __va;
>   va_start(__va, __format);
> @@ -382,7 +388,10 @@
>   return __res;
> }
> 
> -_LIBCPP_ALWAYS_INLINE inline
> +#if !defined(__GNUC__) || (__GNUC_VERSION_CODE > __GNUC_VERSION(4, 7, 2))
> +_LIBCPP_ALWAYS_INLINE
> +#endif
> +inline
> int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
>   va_list __va;
>   va_start(__va, __format);
> @@ -396,7 +405,10 @@
>   return __res;
> }
> 
> -_LIBCPP_ALWAYS_INLINE inline
> +#if !defined(__GNUC__) || (__GNUC_VERSION_CODE > __GNUC_VERSION(4, 7, 2))
> +_LIBCPP_ALWAYS_INLINE
> +#endif
> +inline
> int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
>   va_list __va;
>   va_start(__va, __format);
> <D241.2.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list