Skip to content

[MLIR] Make SymbolTableCollection methods virtual #141760

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 1 commit into from
Jun 3, 2025

Conversation

mscuttari
Copy link
Member

The LockedSymbolTable class not only encapsulate a SymbolTableCollection, but also extends it. However, the methods of SymbolTableCollection are not marked as virtual, and therefore methods receiving a SymbolTableCollection would always call the base methods even if the object was a subclass. The proposed changes consist in marking the base methods as virtual.

@mscuttari mscuttari requested a review from River707 May 28, 2025 13:30
@mscuttari mscuttari marked this pull request as ready for review May 28, 2025 13:30
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels May 28, 2025
@llvmbot
Copy link
Member

llvmbot commented May 28, 2025

@llvm/pr-subscribers-mlir-core

@llvm/pr-subscribers-mlir

Author: Michele Scuttari (mscuttari)

Changes

The LockedSymbolTable class not only encapsulate a SymbolTableCollection, but also extends it. However, the methods of SymbolTableCollection are not marked as virtual, and therefore methods receiving a SymbolTableCollection would always call the base methods even if the object was a subclass. The proposed changes consist in marking the base methods as virtual.


Full diff: https://github.com/llvm/llvm-project/pull/141760.diff

1 Files Affected:

  • (modified) mlir/include/mlir/IR/SymbolTable.h (+21-12)

@mscuttari mscuttari merged commit b4ded99 into llvm:main Jun 3, 2025
16 checks passed
sallto pushed a commit to sallto/llvm-project that referenced this pull request Jun 3, 2025
The `LockedSymbolTable` class not only encapsulate a `SymbolTableCollection`, but also extends it. However, the methods of `SymbolTableCollection` are not marked as `virtual`, and therefore methods receiving a `SymbolTableCollection` would always call the base methods even if the object was a subclass. The proposed changes consist in marking the base methods as `virtual`.
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
The `LockedSymbolTable` class not only encapsulate a `SymbolTableCollection`, but also extends it. However, the methods of `SymbolTableCollection` are not marked as `virtual`, and therefore methods receiving a `SymbolTableCollection` would always call the base methods even if the object was a subclass. The proposed changes consist in marking the base methods as `virtual`.
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
The `LockedSymbolTable` class not only encapsulate a `SymbolTableCollection`, but also extends it. However, the methods of `SymbolTableCollection` are not marked as `virtual`, and therefore methods receiving a `SymbolTableCollection` would always call the base methods even if the object was a subclass. The proposed changes consist in marking the base methods as `virtual`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants