This is an archive of the discontinued LLVM Phabricator instance.

[AST] Move operations enum to a definition file.
ClosedPublic

Authored by etienneb on May 12 2016, 8:19 AM.

Details

Summary

This patch moves the enum definitions to a definition (.def) file.

These modifications provide way to list enumerators of a given type.

As an example, this allow parsing of "kinds" in the dynamic matchers.
see: http://reviews.llvm.org/D19871
The dynamic matcher "ofKind" also required this patch to be fixed.

Diff Detail

Event Timeline

etienneb updated this revision to Diff 57042.May 12 2016, 8:19 AM
etienneb retitled this revision from to [AST] Move operations enum to a definition file..
etienneb updated this object.
etienneb added reviewers: klimek, aaron.ballman.
etienneb added subscribers: cfe-commits, alexfh, sbenza.
etienneb updated this object.May 12 2016, 8:21 AM
etienneb updated this revision to Diff 57043.May 12 2016, 8:51 AM

rebase over AST modifications

etienneb updated this revision to Diff 57045.May 12 2016, 8:54 AM

remove incorrect patch upload (sorry)

Generally, I think this looks good. It will definitely help with AST matchers. Richard, do you have any problems with this approach?

include/clang/AST/OperationKinds.def
15

Do we use @file doxygen comments usually? I'm not certain if I've never seen them, or if I'm just unobservant.

etienneb marked an inline comment as done.May 12 2016, 9:56 AM
include/clang/AST/OperationKinds.def
15

I can't tell if it's largely used.

I based my modifications on 'include/clang/Basic/OperatorKinds.def'

https://llvm.org/svn/llvm-project/cfe/trunk/include/clang/Basic/OperatorKinds.def

And there are doxygen comments.

rsmith edited edge metadata.May 12 2016, 11:07 AM

Generally, I think this looks good. It will definitely help with AST matchers. Richard, do you have any problems with this approach?

Not at all. This would be a nice improvement even if it didn't also provide value to the dynamic matchers.

rsmith accepted this revision.May 12 2016, 11:08 AM
rsmith edited edge metadata.
This revision is now accepted and ready to land.May 12 2016, 11:08 AM
etienneb closed this revision.May 12 2016, 2:04 PM
etienneb marked an inline comment as done.