-
Notifications
You must be signed in to change notification settings - Fork 14
feat!: Add Visibility to FuncDefn/FuncDecl. #2143
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
Merged
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
187cc8b
Cherry-pick call_graph + dead_funcs
acl-cqc a5a18e5
WIP Add link_name, builder methods, update some passes
acl-cqc cabd1bc
Add link_name to hugr-py FuncDefn, update schema
acl-cqc 1d0ac85
FuncDecl: add link_name_mut
acl-cqc 0543ece
FuncDefn deprecations
acl-cqc 231c2cd
FuncDecl deprecation(?)
acl-cqc 68fd467
Remove get_func_name, we have the defn/decl to hand
acl-cqc bf5ead7
model import/export via metadata
acl-cqc c5f4363
And update snapshots
acl-cqc 4dcf9e1
Merge remote-tracking branch 'origin/main' into acl/linking_prelims
acl-cqc 69b33d2
Fix monomorphize test
acl-cqc 2ea97f4
(just) clippy
acl-cqc 71f4106
Move IncludeExports up to root of hugr-passes, use for const_fold, +d…
acl-cqc b5d5e9e
docs
acl-cqc c7c734b
Cherry-pick #2343
acl-cqc 45c8131
model Visibility w/temp(), update capnp, revert model metadata/link_name
acl-cqc c0c170b
Update snapshots again (Revert metadata, add "pub")
acl-cqc 44a1cba
remove commented-out define_funtion_link_name, revert hugr-cli debug
acl-cqc c4c5188
Update hugr-core, revert monomorph; TODO core+model python/bindings
acl-cqc 582142c
Fix parsing; update snapshots - all aliases now output as "pub"
acl-cqc e848eed
Update hugr-py FuncDefn + snapshot
acl-cqc a9acc5f
hugr-py: also FuncDecl
acl-cqc 075b4dc
hugr-model python - no tests but pytest passing
acl-cqc 8d285ac
update-schema
acl-cqc 16da753
Doc fixes
acl-cqc 5d2abf7
doc
acl-cqc 7780a9b
reduce change vs main
acl-cqc 8c82bdc
move priv_vis
acl-cqc ac363bc
model: inline print_vis, rm CORE_META_FUNCNAME
acl-cqc c034749
dead_code use IncludeExports, fix FuncDecl/Const
acl-cqc e1192ee
use deprecation for remove_dead_funcs (add new ..._vis), format
acl-cqc 23f4786
Merge remote-tracking branch 'origin/main' into acl/linking_prelims
acl-cqc 7245487
Avoid deprecated FuncDefn::new in hugr-persistent
acl-cqc 239f179
doc typo
acl-cqc 22df54a
hugr-model: add Visibility::default()==Private, make ops+aliases use …
acl-cqc cfbab3b
hugr-model snapshots
acl-cqc 2acaf65
FuncDefn::new uses public for main else private...TODO define_func, F…
acl-cqc 042d079
Same for define_func/FunctionBuilder::new; remove (_pub,_priv) except…
acl-cqc 939fd9a
Rm default_for_name, all builder methods construct via FuncDefn::new
acl-cqc 44408fe
FuncDecl: remove new_public/new_priv, don't deprecate new
acl-cqc eb26b2f
Fix doc + missing see-also
acl-cqc 0ddd0e7
FuncDefn::new also private but logs if name==main
acl-cqc b0744ea
Revert "FuncDefn::new also private but logs if name==main"
acl-cqc ca43cf1
hugr_core Visibility is not Copy
acl-cqc 5dbed79
hugr-model Visibility not Copyable -> allocate
acl-cqc 40f9c66
Don't mark hugr-model Visibility as non-exhaustive
acl-cqc d2c56dd
Test validate_linkage, improve comment
acl-cqc cacae92
Merge remote-tracking branch 'origin/main' into acl/linking_prelims
acl-cqc 0c360f4
dead_code.rs: Remove bogus allow-deprecated
acl-cqc 723c819
remove_dead_funcs_pass2, fold_constants
acl-cqc 06f3d54
fix rename, fmt
acl-cqc b1e0d9b
Revert DeadCodeElim behaviour on Consts
acl-cqc 74664ad
DeadCodeElim only elims below entrypoint
acl-cqc 4816064
clippy-llvm
acl-cqc 43500f7
Remove declare_private
acl-cqc f80b80e
powerup'd clippy, add quotes
acl-cqc 46e2272
Merge remote-tracking branch 'origin/main' into acl/linking_prelims
acl-cqc 853cc1d
more clippy
acl-cqc 288675c
imports; reduce change
acl-cqc e63265e
Merge remote-tracking branch 'origin/main' into acl/linking_prelims
acl-cqc 2878a28
Merge remote-tracking branch 'origin/main' into acl/linking_prelims
acl-cqc 02bcbe6
All FuncDefn's private
acl-cqc bb5d75b
More clarifications
acl-cqc dbbd8a9
Not quite that bad - dataflow means const-fold preserves non-module e…
acl-cqc 4155429
Further clarify const-fold. Blimey
acl-cqc 7cdf236
not-a-hugr test - this passes but clearly shouldn't
acl-cqc 882c5b0
testing schemas: use TestingHugr; test now fails as desired
acl-cqc c0fa4f1
Replace silly test with better ones
acl-cqc 2127d51
Fix name of NamedSchema
acl-cqc 72ab368
Improve error printing
acl-cqc 0c9739a
Fix prop_roundtrip_type via any_serde_type_{arg,param}...wtf ArrayOrT…
acl-cqc 60f3698
fix roundtrip_poly_func_type
acl-cqc 70d5bb3
Fix roundtrip_optype via any_serde_type_arg_vec
acl-cqc 539e569
Update generate_schema.py to add (Testing|Serial)Hugr|Extension|Packa…
acl-cqc 74bf9e6
Generalize test to cover both testing and main schema
acl-cqc 1d2ba5a
generate_schema uses DEFAULT_REF_TEMPLATE + oneOf
acl-cqc 5caa8d6
Pass path into test
acl-cqc 93bcbc2
Allow ArrayOrTermSer::Term(Term::ListConcat)...but we'll never see that
acl-cqc db68a76
Better comments/todos
acl-cqc a5b65de
Merge remote-tracking branch 'origin/main' into acl/schema_test2
acl-cqc 45b2412
More comment/todo tweaks, test use impl IntoIterator
acl-cqc c001d53
Merge branch 'acl/schema_test2' into acl/linking_prelims
acl-cqc 4f07f9b
and fix test by adding visibility
acl-cqc 3a460a4
Revert hugr-passes changes
acl-cqc 7d5d81d
Merge remote-tracking branch 'origin/main' into acl/schema_test2
acl-cqc 05eb7be
Merge branch 'acl/schema_test2' into acl/linking_prelims
acl-cqc c52ce08
make_simple_hugr docs say public; make it so
acl-cqc 2cbe99f
hugr-core comment on Visibility should not mention optimization/analysis
acl-cqc 61056af
Test loading Hugr w/out visibility
acl-cqc ed79543
Add python test - indeed fails w/ missing visibility
acl-cqc 8592e75
Provide default visibility in pydantic; fix test Node-fiddling
acl-cqc c9fc1b5
Update schema
acl-cqc b32465f
Comment about serde defaults
acl-cqc 5a81bc0
Skip if test file missing
acl-cqc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really right? I would rather not have visibility in the type system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this is a bit misnamed - it's exporting a thing with a poly func type, in fact a specific thing, a
Symbol
. (I mean, it already has aname
parameter, right....)Yes, adding Visibility to Symbol is perhaps a bit of a change (I did check with @zrho first) - I'd argue (1) hugr-model goes for uniformity over tailoring everything to specific cases, (2) adding visibility elsewhere is a big PITA, (3) There's no reason not to apply Visibility to e.g. aliases too, just that we aren't bothered to do this in hugr-core atm.