Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Preprocessing Wrappers #84

Merged
merged 2 commits into from Aug 19, 2019
Merged

Add Preprocessing Wrappers #84

merged 2 commits into from Aug 19, 2019

Conversation

udaken
Copy link
Contributor

@udaken udaken commented Aug 15, 2019

Added few wrapper classes to handle preprocessing cursors..

  • InclusionDirective
  • PreprocessingDirective
  • MacroExpansion
  • MacroDefinition

@msftclas
Copy link

msftclas commented Aug 15, 2019

CLA assistant check
All CLA requirements met.

@@ -80,6 +80,10 @@ internal static Cursor Create(CXCursor handle)
{
result = Attr.Create(handle);
}
else if (handle.IsPreprocessing)
{
result = Preprocessing.Create(handle);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I've tried to mirror the Clang C++ API structure where applicable.

In this case, it would be:

class PreprocessedEntity : Cursor  { }
class MacroExpansion : PreprocessedEntity { }
class PreprocessingDirective : PreprocessedEntity { }
class InclusionDirective : PreprocessingDirective { }
class MacroDefinitionRecord : PreprocessingDirective { }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the C++ API gives a structured layout that closely mirrors the actual OOP API design and allows various bits of code to be shared where it makes sense due to the backing data the cursor handles represent

@tannergooding
Copy link
Member

Overall LGTM.

Just a nit about the layout of the types.

@udaken
Copy link
Contributor Author

udaken commented Aug 18, 2019

@tannergooding Thank you for the review.
I changed it.

@tannergooding tannergooding merged commit 6e994d7 into dotnet:master Aug 19, 2019
@tannergooding
Copy link
Member

Thanks!

@udaken udaken deleted the add_preprocessing_wrappers branch August 20, 2019 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants