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

[SV] Use a symbol in macro identifiers #6777

Merged
merged 1 commit into from Mar 4, 2024
Merged

Conversation

nandor
Copy link
Contributor

@nandor nandor commented Mar 4, 2024

Macro identifiers now use a proper symbol to handle references. The verifiers are not yet enabled as more intrusive pipeline changes are required, to be done in follow-ups.

Macro identifiers now use a proper symbol to handle references.
The verifiers are not yet enabled as more intrusive pipeline changes are required, to be done in follow-ups.
Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

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

LGTM. I think it's reasonable approach to make verifySymbolUses empty and actually implement a follow-up. Could you open an issue to track that? Once verifySymbolUses is implemented, a serious of the changes will require downstream users to ensure uniqueness of the macro symbols so it would be nice to put a note on weekly meeting doc.

Comment on lines +94 to +105
/// Verifies symbols referenced by macro identifiers.
static LogicalResult
verifyMacroIdentSymbolUses(Operation *op, FlatSymbolRefAttr attr,
SymbolTableCollection &symbolTable) {
auto *refOp = symbolTable.lookupNearestSymbolFrom(op, attr);
if (!refOp)
return op->emitError("references an undefined symbol: ") << attr;
if (!isa<MacroDeclOp>(refOp))
return op->emitError("must reference a macro declaration");
return success();
}

Copy link
Member

Choose a reason for hiding this comment

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

Please feel free to land this change separately.

@nandor
Copy link
Contributor Author

nandor commented Mar 4, 2024

Opened #6779 to track this

@nandor nandor merged commit a956b8b into main Mar 4, 2024
4 checks passed
@dtzSiFive dtzSiFive deleted the dev/nandor/macro-ident-sym branch March 4, 2024 15:28
@dtzSiFive
Copy link
Contributor

Awesome work, thanks for pushing on this!

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