This is an archive of the discontinued LLVM Phabricator instance.

[libclang] Only mark CXCursors for explicit attributes with a type
ClosedPublic

Authored by erikjv on Oct 6 2017, 3:56 AM.

Details

Summary

All attributes have a source range associated with it. However, implicit
attributes are added by the compiler, and not added because the user
wrote something in the input. So no token type should be set to
CXCursor_*Attr.

The problem was visible when a class gets marked by e.g.
MSInheritanceAttr, which has the full CXXRecordDecl's range as its
own range. The effect of marking that range as CXCursor_UnexposedAttr
was that all cursors for the record decl, including all child decls,
would become CXCursor_UnexposedAttr.

Diff Detail

Event Timeline

erikjv updated this revision to Diff 117975.Oct 6 2017, 3:56 AM
erikjv created this revision.

Added more context to the diff

ilya-biryukov resigned from this revision.Oct 6 2017, 6:34 AM
ilya-biryukov added a subscriber: ilya-biryukov.

I'm not actually familiar with CXCursor, so can't really help with reviewing this.

yvvan added a subscriber: yvvan.Oct 25 2017, 11:37 PM
This revision is now accepted and ready to land.Apr 17 2018, 2:31 AM
erikjv closed this revision.Apr 24 2018, 1:43 AM

Committed as r330692