r241551 - Use llvm::alignOf rather than alignof()

Richard Smith richard at metafoo.co.uk
Wed Jul 8 09:46:18 PDT 2015


On 6 Jul 2015 9:11 pm, "Douglas Gregor" <dgregor at apple.com> wrote:
>
> Author: dgregor
> Date: Mon Jul  6 23:06:31 2015
> New Revision: 241551
>
> URL: http://llvm.org/viewvc/llvm-project?rev=241551&view=rev
> Log:
> Use llvm::alignOf rather than alignof()
>
> Modified:
>     cfe/trunk/include/clang/AST/TypeLoc.h
>
> Modified: cfe/trunk/include/clang/AST/TypeLoc.h
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=241551&r1=241550&r2=241551&view=diff
>
==============================================================================
> --- cfe/trunk/include/clang/AST/TypeLoc.h (original)
> +++ cfe/trunk/include/clang/AST/TypeLoc.h Mon Jul  6 23:06:31 2015
> @@ -948,8 +948,8 @@ public:
>    }
>
>    unsigned getExtraLocalDataAlignment() const {
> -    static_assert(alignof(ObjCObjectTypeLoc) >= alignof(TypeSourceInfo
*),
> -                  "not enough alignment for tail-allocated data");
> +    assert(llvm::alignOf<ObjCObjectTypeLoc>() >
llvm::alignOf<TypeSourceInfo *>()
> +           && "not enough alignment for tail-allocated data");

You can turn this back into a static_assert by using llvm::AlignOf instead.

>      return llvm::alignOf<TypeSourceInfo *>();
>    }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150708/aae38539/attachment.html>


More information about the cfe-commits mailing list