[lld] r285775 - Make a function in a header "inline" instead of "static".

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 12:47:56 PST 2016


You can just skip the 'inline' keyword on a function template - it'll have
the same linkage anyway.

On Tue, Nov 1, 2016 at 5:26 PM Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ruiu
> Date: Tue Nov  1 19:16:43 2016
> New Revision: 285775
>
> URL: http://llvm.org/viewvc/llvm-project?rev=285775&view=rev
> Log:
> Make a function in a header "inline" instead of "static".
>
> Modified:
>     lld/trunk/ELF/Memory.h
>
> Modified: lld/trunk/ELF/Memory.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Memory.h?rev=285775&r1=285774&r2=285775&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Memory.h (original)
> +++ lld/trunk/ELF/Memory.h Tue Nov  1 19:16:43 2016
> @@ -49,7 +49,7 @@ template <class T> struct SpecificAlloc
>
>  // Use this arean if your object have a destructor.
>  // Your destructor will be invoked from freeArena().
> -template <typename T, typename... U> static T *make(U &&... Args) {
> +template <typename T, typename... U> inline T *make(U &&... Args) {
>    static SpecificAlloc<T> Alloc;
>    return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...);
>  }
>
>
> _______________________________________________
> 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/20161108/f47b4d27/attachment.html>


More information about the llvm-commits mailing list