[cfe-commits] [PATCH] Update the front end to use minsize attribute

Dmitri Gribenko gribozavr at gmail.com
Tue Oct 30 12:36:59 PDT 2012


Hi Quentin,

On Tue, Oct 30, 2012 at 9:13 PM, Quentin Colombet <qcolombet at apple.com> wrote:
> Following commits r167020 and r167021, which define MinSize attribute for functions and set it when Oz optimization level is used, I propose this patch to be able to use this attribute (minsize) directly in the front end.

+  if (!isa<FunctionDecl>(D)) {
+    S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+      << Attr.getName() << ExpectedFunction;
+    return;
+  }

Why not reject this with an error?  This is a new attribute, there is
no legacy code misusing it, nor other compilers tolerating such
misuse.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list