<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This needs an IRGen test to show that pragma is effective.<div><br></div><div>- Fariborz</div><div><br><div><div>On Apr 17, 2013, at 6:42 PM, Argyrios Kyrtzidis <<a href="mailto:akyrtzi@gmail.com">akyrtzi@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: akirtzidis<br>Date: Wed Apr 17 20:42:35 2013<br>New Revision: 179743<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=179743&view=rev">http://llvm.org/viewvc/llvm-project?rev=179743&view=rev</a><br>Log:<br>[Parser] Handle #pragma pack/align inside C structs.<br><br>Fixes PR13580. Patch by Serge Pavlov!<br><br>Modified:<br> cfe/trunk/lib/Parse/ParseDecl.cpp<br> cfe/trunk/test/Parser/pragma-options.c<br> cfe/trunk/test/Parser/pragma-pack.c<br><br>Modified: cfe/trunk/lib/Parse/ParseDecl.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=179743&r1=179742&r2=179743&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=179743&r1=179742&r2=179743&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)<br>+++ cfe/trunk/lib/Parse/ParseDecl.cpp Wed Apr 17 20:42:35 2013<br>@@ -3230,6 +3230,16 @@ void Parser::ParseStructUnionBody(Source<br> continue;<br> }<br><br>+ if (<a href="http://tok.is/">Tok.is</a>(tok::annot_pragma_pack)) {<br>+ HandlePragmaPack();<br>+ continue;<br>+ }<br>+<br>+ if (<a href="http://tok.is/">Tok.is</a>(tok::annot_pragma_align)) {<br>+ HandlePragmaAlign();<br>+ continue;<br>+ }<br>+<br> if (!<a href="http://tok.is/">Tok.is</a>(tok::at)) {<br> struct CFieldCallback : FieldCallback {<br> Parser &P;<br><br>Modified: cfe/trunk/test/Parser/pragma-options.c<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/pragma-options.c?rev=179743&r1=179742&r2=179743&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/pragma-options.c?rev=179743&r1=179742&r2=179743&view=diff</a><br>==============================================================================<br>--- cfe/trunk/test/Parser/pragma-options.c (original)<br>+++ cfe/trunk/test/Parser/pragma-options.c Wed Apr 17 20:42:35 2013<br>@@ -20,3 +20,15 @@<br>#pragma align=reset<br>#pragma align=mac68k<br>#pragma align=power<br>+<br>+// PR13580<br>+struct S<br>+{<br>+ char a[3];<br>+#pragma align=packed<br>+ struct T<br>+ {<br>+ char b;<br>+ int c;<br>+ } d;<br>+};<br><br>Modified: cfe/trunk/test/Parser/pragma-pack.c<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/pragma-pack.c?rev=179743&r1=179742&r2=179743&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/pragma-pack.c?rev=179743&r1=179742&r2=179743&view=diff</a><br>==============================================================================<br>--- cfe/trunk/test/Parser/pragma-pack.c (original)<br>+++ cfe/trunk/test/Parser/pragma-pack.c Wed Apr 17 20:42:35 2013<br>@@ -30,3 +30,17 @@<br><br>_Pragma("pack(push)")<br>/* expected-warning {{expected integer or identifier in '#pragma pack'}}*/ _Pragma("pack(push,)")<span class="Apple-converted-space"> </span><br>+<br>+// PR13580<br>+struct S<br>+{<br>+ char a[3];<br>+#pragma pack(1)<br>+ struct T<br>+ {<br>+ char b;<br>+ int c;<br>+ } d;<br>+#pragma pack()<br>+ int e;<br>+};<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div><br></div></body></html>