Repository navigation
[JITLink][ORC] Clean up unused and assert-only function templates (NFC) - #202973
Merged
Merged
Conversation
These function templates trip `-Wunused-template`. In `aarch32.cpp`, `writeRegister` has no callers, so it's removed. `checkRegister` is only used inside `assert`, so it gets compiled out in release builds (`-DNDEBUG`) and never instantiates; it's marked `[[maybe_unused]]`. Same story for `stubAndPointerRangesOk` in `OrcABISupport.cpp`, which is only used in asserts. NFC. Part of llvm#202945.
Member
Author
|
ping @lhames @weliveindetail |
LouisLu060211
pushed a commit
to LouisLu060211/llvm-project
that referenced
this pull request
Jun 30, 2026
…C) (llvm#202973) These function templates trip `-Wunused-template`. In `aarch32.cpp`, `writeRegister` has no callers, so it's removed. `checkRegister` is only used inside `assert`, so it gets compiled out in release builds (`-DNDEBUG`) and never instantiates; it's marked `[[maybe_unused]]`. Same story for `stubAndPointerRangesOk` in `OrcABISupport.cpp`, which is only used in asserts. NFC. Part of llvm#202945.
maarcosrmz
pushed a commit
to maarcosrmz/llvm-project
that referenced
this pull request
Jul 1, 2026
…C) (llvm#202973) These function templates trip `-Wunused-template`. In `aarch32.cpp`, `writeRegister` has no callers, so it's removed. `checkRegister` is only used inside `assert`, so it gets compiled out in release builds (`-DNDEBUG`) and never instantiates; it's marked `[[maybe_unused]]`. Same story for `stubAndPointerRangesOk` in `OrcABISupport.cpp`, which is only used in asserts. NFC. Part of llvm#202945.
vgvassilev
pushed a commit
that referenced
this pull request
Jul 6, 2026
Uncomment `UnusedTemplate` in the `Unused` diagnostic group so `-Wunused-template` becomes part of `-Wall`. `-Wunused-template` flags unused function and variable templates with internal linkage. In a header, such a template gives every translation unit its own internal-linkage copy, which is a latent ODR violation (ill-formed, no diagnostic required), so enabling this surfaces a real class of bugs and keeps the pattern from reappearing. ### Depends on The in-tree occurrences were cleaned up first in a series of NFC PRs tracked by #202945. This change only builds clean once those land, so CI will be red on any area whose cleanup is not yet merged. Remaining prerequisites: Approved - #202969 - #202971 - #202973 - #202974 - #206309 - #206312 Needs to be reviewed - #202988 - #206308 Closes #202945 cc @AaronBallman @vgvassilev
gandhi56
pushed a commit
that referenced
this pull request
Jul 9, 2026
Uncomment `UnusedTemplate` in the `Unused` diagnostic group so `-Wunused-template` becomes part of `-Wall`. `-Wunused-template` flags unused function and variable templates with internal linkage. In a header, such a template gives every translation unit its own internal-linkage copy, which is a latent ODR violation (ill-formed, no diagnostic required), so enabling this surfaces a real class of bugs and keeps the pattern from reappearing. ### Depends on The in-tree occurrences were cleaned up first in a series of NFC PRs tracked by #202945. This change only builds clean once those land, so CI will be red on any area whose cleanup is not yet merged. Remaining prerequisites: Approved - #202969 - #202971 - #202973 - #202974 - #206309 - #206312 Needs to be reviewed - #202988 - #206308 Closes #202945 cc @AaronBallman @vgvassilev
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.
These function templates trip
-Wunused-template.In
aarch32.cpp,writeRegisterhas no callers, so it's removed.checkRegisteris only used insideassert, so it gets compiled out in release builds (-DNDEBUG) and never instantiates; it's marked[[maybe_unused]]. Same story forstubAndPointerRangesOkinOrcABISupport.cpp, which is only used in asserts.NFC.
Part of #202945.