[cfe-commits] r156657 - in /cfe/trunk: lib/Sema/SemaDeclAttr.cpp test/Sema/attr-aligned.c
Douglas Gregor
dgregor at apple.com
Fri May 11 16:01:43 PDT 2012
Author: dgregor
Date: Fri May 11 18:01:43 2012
New Revision: 156657
URL: http://llvm.org/viewvc/llvm-project?rev=156657&view=rev
Log:
Make sure that we recognize __attribute__((align)) as a synonym for
__attribute__((aligned)). Fixes <rdar://problem/11435441>, a
regression I introduced in r156003. This is the narrow fix; a more
comprehensive fix is coming.
Modified:
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/test/Sema/attr-aligned.c
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=156657&r1=156656&r2=156657&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Fri May 11 18:01:43 2012
@@ -3792,6 +3792,7 @@
// by ProcessNonInheritableDeclAttr.
break;
case AttributeList::AT_alias: handleAliasAttr (S, D, Attr); break;
+ case AttributeList::AT_align:
case AttributeList::AT_aligned: handleAlignedAttr (S, D, Attr); break;
case AttributeList::AT_always_inline:
handleAlwaysInlineAttr (S, D, Attr); break;
Modified: cfe/trunk/test/Sema/attr-aligned.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-aligned.c?rev=156657&r1=156656&r2=156657&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-aligned.c (original)
+++ cfe/trunk/test/Sema/attr-aligned.c Fri May 11 18:01:43 2012
@@ -32,7 +32,7 @@
char d1[__alignof__(d) == 2 ?: -1] = {0};
char d2[__alignof__(d.member) == 2 ?: -1] = {0};
-struct E { int member __attribute__((aligned(2))); } __attribute__((packed));
+struct E { int member __attribute__((align(2))); } __attribute__((packed));
struct E e;
char e1[__alignof__(e) == 2 ?: -1] = {0};
char e2[__alignof__(e.member) == 2 ?: -1] = {0};
More information about the cfe-commits
mailing list