[cfe-dev] [RFC] Starting support for SAL

Anna Zaks ganna at apple.com
Mon Nov 28 18:52:24 PST 2011


Hi Aaron,

I did a brief search for patents on "source code annotation language" and came up with this one, which seems to be patenting SAL annotations. (In particular, they talk about pre and post, writableTo, checkReturn… ) 
http://www.google.com/patents/about/7584458_Source_code_annotation_language.html?id=-2jKAAAAEBAJ

Looks like this patch might infringe on the patent and if so it should not be committed; see the LLVM developer policy:
http://llvm.org/docs/DeveloperPolicy.html#clp

Thanks for the initiative, it would be a great addition!
Anna.

On Oct 30, 2011, at 11:40 AM, Aaron Ballman wrote:

> I am starting to add support for Microsoft's source annotations so
> that they can be used in the static analyzer.  Before I go too far
> into the implementation, I am wondering whether I'm approaching the
> problem properly.
> 
> SAL has two separate implementations, depending on the compiler.
> Older versions of MSVC use __declspec to implement the annotations,
> and newer versions of MSVC use Microsoft's basically undocumented
> attribute syntax.  Initially, I am only implementing support for the
> __declspec syntax, but would eventually like to support the attribute
> syntax as well.  The __declspec syntax relies on ordering of the
> annotations.  For instance, __declspec( "SAL_pre" ) __declspec(
> "SAL_notnull" ) is not the same as __declspec( "SAL_notnull" )
> __declspec( "SAL_pre" ).
> 
> I've created separate attributes for each of the SAL notations, and I
> parse them in ParseMicrosoftDeclSpec.  Some of the notations are
> simple declspecs, and others have parameters to parse.  Currently, I
> am only parsing the simple ones, but I intend to parse the
> parameterized ones and store the parameter information on the
> attribute objects.  All of the SAL declspecs are string literals.
> 
> I've attached an early stage patch, and am looking for feedback on
> whether I am going about this properly, or if there is a better way.
> 
> Thanks!
> 
> ~Aaron
> <SAL.diff>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111128/e0fcf7b4/attachment.html>


More information about the cfe-dev mailing list