[cfe-dev] [PATCH] Improve __interface support

João Matos ripzonetriton at gmail.com
Sat Aug 18 00:58:08 PDT 2012


Hi, nice patch.


NewFD->setVirtualAsWritten(true);

Do we need to set this on the method? According to the docs, this should
only be set if virtual was explicitly written in the code.



-  if (!isDefinition || (NewTag != TTK_Class && NewTag != TTK_Struct))
-    if (OldTag == NewTag)
-      return true;
+  if (!isDefinition || !isClassCompatTagKind(NewTag) || OldTag == NewTag)
+    return true;

The behaviour of the code is changed here, though I'm not sure if that has
any impact on correctness.



+    default: assert("Invalid tag kind for field padding diagnostic!");

You used this assert message on a couple diagnostic index helper functions
which is incorrect for some. Seems to be a simple copy paste mismatch.


+    case TTK_Interface:
       Out << 'U';

Did you confirm that cl mangles interfaces as structs?


+      case TTK_Interface:
+      case TTK_Struct: return CXCursor_StructDecl;

I think we should add a new cursor in the C API, and not re-use
CXCursor_StructDecl for interfaces.



On Sat, Aug 18, 2012 at 5:40 AM, David Robins <llvm at davidrobins.net> wrote:
>
> This is a rework of the previous patch I posted, this time with
> __interface as a class-key rather than struct with an attribute.
>
> All tests are currently passing, and I modified the Microsoft extension
> test to account for some new capabilities.
>
> I do not have commit access, so if this patch is acceptable I will need
> someone else to commit it. If changes are required first, I am as before
> happy to make them, and to later support this addition.
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



--
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120818/dc370b1e/attachment.html>


More information about the cfe-dev mailing list