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 instructions for how to add a diagnostic to gaiat #843

Merged
merged 7 commits into from
Aug 18, 2021

Conversation

daxhaw
Copy link
Contributor

@daxhaw daxhaw commented Aug 18, 2021

Should have included instructions on how to add errors to gaiat going forward in the last PR.

Note: I'm also using this PR to push in a fix for an llvm-test break. I added a warning group for GaiaExtensions (gaia-extensions)

Copy link
Contributor

@simone-gaia simone-gaia left a comment

Choose a reason for hiding this comment

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

LGTM

// 2) Use 'gaiat::diag().emit(...)' to get the diagnostics engine and pass in the error string. The IDs and other info
// are generated from the DiagnosticsSemaKinds.td file and put into the 'diag' namespace.
//
// 3) You can set the source location to give the user line and column information about the error. This can
Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor Aug 18, 2021

Choose a reason for hiding this comment

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

I'm confused about what we mean by "user line".

Should to give the user line and column information about the error be to give line and column information about the error to the user?

Or is there some other word missing there?

Copy link
Contributor Author

@daxhaw daxhaw Aug 18, 2021

Choose a reason for hiding this comment

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

I should probably specify line and column number information. And 'user' really means the rule author.

Copy link
Contributor

Choose a reason for hiding this comment

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

This reminds me that we should specify that the line and column number are relative to the ruleset file and not the generated cpp. I remember there was some uncertainty about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Updated the text to make this more clear.

@@ -10,6 +10,32 @@
#include "clang/Basic/Diagnostic.h"
#pragma clang diagnostic pop

// When adding errors strings to the translation engine, please use the llvm
Copy link
Contributor

Choose a reason for hiding this comment

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

llvm -> LLVM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FIXED :)

Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor left a comment

Choose a reason for hiding this comment

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

Looks good. Just added a minor suggestion.

@daxhaw
Copy link
Contributor Author

daxhaw commented Aug 18, 2021

Thanks @LaurentiuCristofor and @simone-gaia

@daxhaw daxhaw merged commit 5da91ad into master Aug 18, 2021
@daxhaw daxhaw deleted the dax/gaiat_diag_help branch August 18, 2021 21:27
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.

3 participants