[llvm] r247252 - [Support] Fix the always_inline attribute macro to not include the

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 08:20:37 PDT 2015


On Thu, Sep 10, 2015 at 1:29 AM, Chandler Carruth via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: chandlerc
> Date: Thu Sep 10 03:29:30 2015
> New Revision: 247252
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247252&view=rev
> Log:
> [Support] Fix the always_inline attribute macro to not include the
> 'inline' specifier. That specifier may or may not be valid for a given
> function,


When is it not valid for a given function?


> or it may be required for correct linkage even when the
> compiler doesn't support the always_inline attribute.
>

Not sure I follow this case - the macro doesn't redundantly specify the
inline keyword (& even then, specifying it twice is valid but redundant,
maybe?), so it just means users of the macro don't need to/shouldn't /also/
explicitly use the inline keyword on the same declaration.


>
> Modified:
>     llvm/trunk/include/llvm/Support/Compiler.h
>
> Modified: llvm/trunk/include/llvm/Support/Compiler.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=247252&r1=247251&r2=247252&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/Compiler.h (original)
> +++ llvm/trunk/include/llvm/Support/Compiler.h Thu Sep 10 03:29:30 2015
> @@ -189,7 +189,7 @@
>  /// 3.4 supported this but is buggy in various cases and produces
> unimplemented
>  /// errors, just use it in GCC 4.0 and later.
>  #if __has_attribute(always_inline) || LLVM_GNUC_PREREQ(4, 0, 0)
> -#define LLVM_ATTRIBUTE_ALWAYS_INLINE inline __attribute__((always_inline))
> +#define LLVM_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
>  #elif defined(_MSC_VER)
>  #define LLVM_ATTRIBUTE_ALWAYS_INLINE __forceinline
>  #else
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150910/3dbdc306/attachment.html>


More information about the llvm-commits mailing list