Deprecate TailStrategy::Predicate in favor of GuardWithIf - #9446
Open
mcourteaux wants to merge 1 commit into
Open
Deprecate TailStrategy::Predicate in favor of GuardWithIf#9446mcourteaux wants to merge 1 commit into
mcourteaux wants to merge 1 commit into
Conversation
Predicate has been behaviorally identical to GuardWithIf for a while (ApplySplit.cpp already routed both to the same code path). Give it the same enum value as GuardWithIf and mark it [[deprecated]] as the first step of the deprecation plan in #9443; remove it entirely in a future release. Since the two values now compare equal, the switch statements over TailStrategy in IRPrinter.cpp, ApplySplit.cpp, and Serialization.cpp no longer need a separate case for Predicate. Deserialization.cpp still maps the old serialized Predicate value to GuardWithIf without referencing the deprecated identifier. The Python binding keeps exposing TailStrategy.Predicate for this release, with the deprecation warning locally suppressed. Internal uses of TailStrategy::Predicate in tests and the hannk app are switched to GuardWithIf. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9446 +/- ##
==========================================
+ Coverage 69.84% 69.93% +0.09%
==========================================
Files 261 261
Lines 79615 79605 -10
Branches 19402 19398 -4
==========================================
+ Hits 55606 55674 +68
+ Misses 18042 18013 -29
+ Partials 5967 5918 -49 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
First step of the deprecation plan in #9443:
TailStrategy::Predicatenow shares the same underlying enum value asTailStrategy::GuardWithIf(they have been behaviorally identical inApplySplit.cppfor a while) and is marked[[deprecated]].TailStrategy(ApplySplit.cpp,IRPrinter.cpp,Serialization.cpp) no longer need a separatecaseforPredicate, since it now compiles to the same value asGuardWithIf.Deserialization.cppmaps old serializedPredicatepipelines toGuardWithIfdirectly, without referencing the deprecated identifier.Func.cpp's exact-split legality check is simplified accordingly.TailStrategy.Predicatefor this release (with the deprecation warning locally suppressed), per the plan to remove it for real only in the release after next.TailStrategy::Predicatein a handful of tests and the hannk app to useGuardWithIfinstead, so the codebase doesn't trigger its own new deprecation warning.Closes #9443 (partially — the follow-up release will remove
Predicateentirely).Test plan
libHalidebuilds clean (no warnings) with these changesSerialization.cpp,Deserialization.cpp, andPyEnums.cppindividually syntax-checked with-Wdeprecated-declarations: none triggeredclang-format --dry-run --Werrorclean on all touched filespre-commit run --all-filespassed on the commit🤖 Generated with Claude Code