-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Clean up IRVariable
s using final aliases
#16415
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
Conversation
…as'ing to ensure that we don't accidentially extend the abstract base class.
@@ -17,18 +17,11 @@ | |||
* The variable may be a user-declared variable (`IRUserVariable`) or a temporary variable generated | |||
* by the AST-to-IR translation (`IRTempVariable`). | |||
*/ | |||
class IRVariable extends TIRVariable { | |||
abstract private class AbstractIRVariable extends TIRVariable { |
Check warning
Code scanning / CodeQL
UnusedField
@@ -17,18 +17,11 @@ | |||
* The variable may be a user-declared variable (`IRUserVariable`) or a temporary variable generated | |||
* by the AST-to-IR translation (`IRTempVariable`). | |||
*/ | |||
class IRVariable extends TIRVariable { | |||
abstract private class AbstractIRVariable extends TIRVariable { |
Check warning
Code scanning / CodeQL
UnusedField
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.
LGTM if DCA is happy.
Took me a bit to figure out that all the restrictions from the char preds are covered in the subclassed (as they sometimes look a bit different there), but this all seems ok.
DCA was uneventful (as expected) |
This PR is just a simple refactoring of the
IRVariable
files that replaces explicit enumeration of subclasses in the base class with abstract classes.In order to ensure no other code accidentally extends the new abstract classes they're kept private and final aliases are provided. This means code will continue to work exactly as before.