[PATCH] add __attribute__ no_uninitialized_checks. Map no_uninitialized_checks/no_thread_safety_analysis to LLVM function attributes.

Kostya Serebryany kcc at google.com
Mon Feb 11 06:54:56 PST 2013



================
Comment at: lib/Sema/SemaDeclAttr.cpp:655-656
@@ +654,4 @@
+  if (!isa<FunctionDecl>(D) && !isa<FunctionTemplateDecl>(D)) {
+    S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+      << Attr.getName() << ExpectedFunctionOrMethod;
+    return;
----------------
Dmitri Gribenko wrote:
> Can we promote this to an error?  There's no existing code that (mis)uses this attribute, so there should be no compatibility concerns.
> 
> Please also add tests for this warning or error, and for checkAttributeNumArgs() condition above.
I copy-pasted the code from the pre-existing code for no_thread_safety_analysis
and I did not fund such tests for that one. 
I guess we need tests for all 3 (+ no_address_safety_analysis). 
Where is the best place for them? Do you know similar existing tests? 

Yes, I guess we can make it an error. Will do the change tomorrow. 


http://llvm-reviews.chandlerc.com/D390



More information about the cfe-commits mailing list