<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">CCing Rafael.<div><br></div><div>Anna.<br><div><div>On May 10, 2012, at 11:03 AM, jahanian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Following patch has broken a dejagnu test in couple of places.Failing part is attached.</div><div>Couple of warnings are missing. </div><div><br></div><div>- Fariborz</div><div><br></div><div><h3 style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; ">Change #77256</h3><table class="info" style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><tbody><tr class="alt" style="background-color: rgb(246, 246, 246); "><td class="left" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: left; ">Changed by</td><td style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: center; "><b>rafael</b></td></tr><tr class=""><td class="left" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: left; ">Changed at</td><td style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: center; "><b>Wed 09 May 2012 19:50:16</b></td></tr><tr class="alt" style="background-color: rgb(246, 246, 246); "><td class="left" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: left; ">Repository</td><td style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: center; "><b>smooshlab-project</b></td></tr><tr class=""><td class="left" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: left; ">Revision</td><td style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; text-align: center; "><a href="http://llvm.org/viewvc/llvm-project?view=rev&revision=156531" style="color: rgb(68, 68, 68); ">156531</a></td></tr></tbody></table><h3 style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; ">Comments</h3><pre class="comments" style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; ">Fix an old (2009) FIXME:

// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.

This was already being done for variables, but for functions we were merging
then first and then applying the attributes. To avoid duplicating merging
logic, some of the helpers in SemaDeclAttr.cpp become methods that can
handle merging two attributes in one decl or inheriting attributes from one
decl to another.

With this change we are now able to produce errors for variables with
incompatible visibility attributes or warn about unused dllimports in
variables.

This changes the attribute list iteration back to being in reverse source
code order, as that matches what decl merging does and avoids differentiating
the two cases is the merge*Attr methods.</pre><h3 class="files" style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; ">Changed files</h3><ul style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; "><li class="alt" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; background-color: rgb(246, 246, 246); "><b>include/clang/Sema/Sema.h</b></li><li class="" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; "><b>lib/Sema/SemaDecl.cpp</b></li><li class="alt" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; background-color: rgb(246, 246, 246); "><b>lib/Sema/SemaDeclAttr.cpp</b></li><li class="" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; "><b>lib/Sema/TargetAttributesSema.cpp</b></li><li class="alt" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; background-color: rgb(246, 246, 246); "><b>test/Index/complete-with-annotations.cpp</b></li><li class="" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; "><b>test/Sema/attr-visibility.c</b></li><li class="alt" style="padding-top: 0.1em; padding-right: 1em; padding-bottom: 0.1em; padding-left: 1em; background-color: rgb(246, 246, 246); "><b>test/Sema/dllimport-dllexport.c</b></li></ul><div style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; "><br></div><div style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; "><br></div><div style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; "><br></div><div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>/* { dg-options "-std=gnu99 -Wformat" } */</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>#include <stdarg.h></b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...)</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>     __attribute__((__format__(__printf__, 1, 0)));</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...)</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>     __attribute__((__format__(__scanf__, 3, 4)));</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b><br></b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...)</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>     __attribute__((__format__(__scanf__, 3, 4)));</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...)</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>     __attribute__((__format__(__printf__, 1, 0)));</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b><br></b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>void</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>foo (va_list ap, int *ip, long *lp)</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>{</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>  my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>  my_vprintf_scanf4 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */</b></font></div><div><font class="Apple-style-span" color="#333333" face="Verdana, Cursor" size="2"><b>}</b></font></div></div><div style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; "><br></div></div><div style="color: rgb(51, 51, 51); font-family: Verdana, Cursor; font-size: 10px; font-weight: bold; "><br></div></div>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></div></body></html>