[llvm-commits] PATCH : change clang Attrs.td to avoid conflict w/MinGW basetyps.h

Ted Kremenek kremenek at apple.com
Mon Feb 14 09:06:09 PST 2011


Hi Kirk,

You're emailing the wrong mailing list.  This patch should go to cfe-commits.

Ted

On Feb 14, 2011, at 8:14 AM, kirk.beitz at nokia.com wrote:

> Trying again because i didn't see a response to this previously (11 days ago), and i don't have permissions in the svn repository to commit this, yet.
> 
> Attached, please find a patch to tools/clang/include/clang/Basic/Attrs.td
> 
> It is used to generate tools/clang/includes/clang/AST/Attrs.inc, which gets #included by Attr.h (which in turn is getting #included several nested levels deep in our effort to build lldb under MinGW ).
> 
> Without this change, one of the classes to be generated defined "Args=Interface".
> 
> This causes the generated class to contain a private member named "interface".
> 
> Under MinGW, when code #includes Attr.h and "basetyps.h" from MinGW before it, a conflict results, because MinGW's basetypes.h will (under most circumstances) pull in windows headers which have the following macro definition:
> 
> #define interface struct
> 
> The patch shows that 'Interface' is simply changed to 'InterFace' (with the F capitalized) so that the private member variable that gets generated becomes "interFace".
> 
> This mimics style elsewhere in Attrs.td (e.g. "Args=>FormatIdx" causes a private member formatIdx to be generated).
> 
> The capitalization difference leads to the resolution of the conflict with MinGW's basetypes.h .
> 
> Thanks in advance for any review/comments/feedback.
> 
> 
> Index: include/clang/Basic/Attr.td
> ===================================================================
> --- include/clang/Basic/Attr.td
> (revision 123723)
> +++ include/clang/Basic/Attr.td
> (working copy)
> @@ -258,7 +258,7 @@
>  
>  def IBOutletCollection : Attr {
>    let Spellings = ["iboutletcollection"];
> -  let Args = [TypeArgument<"Interface">];
> +  let Args = [TypeArgument<"InterFace">];
>  }
>  
>  def Malloc : Attr {
> 
> 
> 
> <Attr.td.patch>
> 
> ++ kirk beitz : nokia : austin + san diego : kirk.beitz at nokia.com ++
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110214/5e834bea/attachment.html>


More information about the llvm-commits mailing list