This repository was archived by the owner on Feb 21, 2026. It is now read-only.
[CIR] Add support for typeid l-value emission#2001
Draft
lanza wants to merge 3 commits intogh/lanza/5/basefrom
Draft
[CIR] Add support for typeid l-value emission#2001lanza wants to merge 3 commits intogh/lanza/5/basefrom
lanza wants to merge 3 commits intogh/lanza/5/basefrom
Conversation
lanza
added a commit
that referenced
this pull request
Nov 22, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: be0adc5 Pull-Request: #2001
This was referenced Nov 22, 2025
This was referenced Nov 22, 2025
Draft
lanza
added a commit
that referenced
this pull request
Nov 24, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
This was referenced Nov 24, 2025
lanza
added a commit
that referenced
this pull request
Nov 25, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
that referenced
this pull request
Nov 25, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
that referenced
this pull request
Nov 26, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
that referenced
this pull request
Nov 26, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
that referenced
this pull request
Nov 26, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
that referenced
this pull request
Nov 26, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
that referenced
this pull request
Nov 27, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e9886 Pull-Request: #2001
lanza
added a commit
to lanza/llvm-project
that referenced
this pull request
Dec 4, 2025
Implements support for typeid expressions as l-values, matching traditional CodeGen behavior. The typeid operator returns a const reference to std::type_info, which requires creating an l-value from the RTTI descriptor. Key changes: - CIRGenExprCXX: Add emitCXXTypeidExpr to emit GetGlobalOp for RTTI descriptors - CIRGenExpr: Add emitCXXTypeidLValue to create l-value from typeid expression - Refactored duplicate RTTI lookup code into helper lambda - Added comprehensive tests covering type operands, expression operands, and polymorphic types Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification. Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with llvm_unreachable. ghstack-source-id: e5e988639148fc0e73faedc22575ba9c5f2ba972 Pull-Request: llvm/clangir#2001
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Stack from ghstack (oldest at bottom):
Implements support for typeid expressions as l-values, matching traditional
CodeGen behavior. The typeid operator returns a const reference to std::type_info,
which requires creating an l-value from the RTTI descriptor.
Key changes:
polymorphic types
Tests include CIR, LLVM (via CIR), and OGCG (Original CodeGen) output verification.
Note: Polymorphic typeid (vtable lookup) is not yet implemented and guarded with
llvm_unreachable.