Skip to content

Compilation: Add CheckUninstantiated flag - #1901

Merged
MikePopoloski merged 1 commit into
MikePopoloski:masterfrom
AndrewNolte:AndrewNolte/stack/18
Jul 28, 2026
Merged

Compilation: Add CheckUninstantiated flag#1901
MikePopoloski merged 1 commit into
MikePopoloski:masterfrom
AndrewNolte:AndrewNolte/stack/18

Conversation

@AndrewNolte

@AndrewNolte AndrewNolte commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Stacked PRs:


View individual changes

Compilation: Add CheckUninstantiated flag

This compilation flag enables more checks to be done in untaken generate branches, or gen loops with invalid loop params.

AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Jul 14, 2026
stack-info: PR: MikePopoloski#1901, branch: AndrewNolte/stack/18
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch from 007b97f to 54a6363 Compare July 14, 2026 19:56
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.05%. Comparing base (3c984ff) to head (c2c4ae4).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1901   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files         247      247           
  Lines       56693    56708   +15     
=======================================
+ Hits        54455    54470   +15     
  Misses       2238     2238           
Files with missing lines Coverage Δ
include/slang/ast/Compilation.h 100.00% <100.00%> (ø)
source/ast/Compilation.cpp 96.73% <100.00%> (+0.03%) ⬆️
source/ast/symbols/BlockSymbols.cpp 98.48% <100.00%> (+<0.01%) ⬆️
source/ast/symbols/InstanceSymbols.cpp 96.93% <100.00%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c984ff...c2c4ae4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AndrewNolte
AndrewNolte marked this pull request as draft July 15, 2026 13:54
AndrewNolte added a commit to AndrewNolte/slang that referenced this pull request Jul 15, 2026
This compilation flag enables more checks to be done in untaken generate branches, or gen loops with invalid loop params.

stack-info: PR: MikePopoloski#1901, branch: AndrewNolte/stack/18
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch from a13e283 to 83f13bc Compare July 15, 2026 13:54
@AndrewNolte
AndrewNolte marked this pull request as ready for review July 15, 2026 13:54
@AndrewNolte
AndrewNolte marked this pull request as draft July 15, 2026 14:50
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch from 89466bd to f49a2fb Compare July 15, 2026 14:50
@AndrewNolte
AndrewNolte marked this pull request as ready for review July 15, 2026 14:50
@AndrewNolte
AndrewNolte marked this pull request as draft July 15, 2026 17:09
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch 2 times, most recently from 4f47b47 to 7a1c229 Compare July 15, 2026 17:09
@AndrewNolte
AndrewNolte marked this pull request as ready for review July 15, 2026 17:09
@AndrewNolte
AndrewNolte marked this pull request as draft July 15, 2026 17:18
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch from 7a1c229 to ae0d401 Compare July 15, 2026 17:18
@AndrewNolte
AndrewNolte marked this pull request as ready for review July 15, 2026 17:18
Comment thread include/slang/ast/Symbol.h Outdated
bool isValue() const;

/// Determines whether this symbol is instantiated.
bool isInstantiated() const;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is a confusing method to add since Scopes have an isUninstantiated method already. I think it should stay a helper in the Compilation file.

Comment thread source/ast/symbols/BlockSymbols.cpp Outdated

result->entries = entries.copy(comp);
if (entries.empty()) {
// Keep result->entries empty so indexed lookup (g[0], etc.) still reports

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This whole comment is pretty hard to understand. It's also unclear to me why the else block was removed, this should be the same behavior right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

createBlock() adds to entries, so the loop actually does get traversed. This makes it such that AST Visitors can visit this uninstantiated scope, but it's still not accessible by a gen_arr[0] ref bc it's an uninstantiated block

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But it doesn't add to result->entries. I could change it to just result->addMember(entries[0]) to avoid the loop.

Comment thread source/ast/Compilation.cpp Outdated
@AndrewNolte
AndrewNolte marked this pull request as draft July 16, 2026 19:15
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch 3 times, most recently from a4ddc02 to 0421c30 Compare July 16, 2026 19:17
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch 3 times, most recently from 3495ade to 5a75153 Compare July 21, 2026 14:16
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch 2 times, most recently from 8813363 to 015e587 Compare July 22, 2026 15:50
This compilation flag enables more checks to be done in untaken generate branches, or gen loops with invalid loop params.

stack-info: PR: MikePopoloski#1901, branch: AndrewNolte/stack/18
@AndrewNolte
AndrewNolte force-pushed the AndrewNolte/stack/18 branch from 015e587 to c2c4ae4 Compare July 23, 2026 17:37
@AndrewNolte
AndrewNolte marked this pull request as ready for review July 27, 2026 15:14
@MikePopoloski
MikePopoloski merged commit 866a245 into MikePopoloski:master Jul 28, 2026
19 checks passed
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.

2 participants