File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -438,6 +438,10 @@ struct MissingFeatures {
438438 // do not yet support this yet.
439439 static bool inallocaArgs () { return false ; }
440440
441+ // C++ typeid expression support (returns type_info object reference)
442+ // Requires RTTI support including vtable lookups for polymorphic types.
443+ static bool cxxTypeid () { return false ; }
444+
441445 // Parameters may have additional attributes (e.g. [[noescape]]) that affect
442446 // the compiler. This is not yet supported in CIR.
443447 static bool extParamInfo () { return false ; }
Original file line number Diff line number Diff line change @@ -2101,6 +2101,11 @@ LValue CIRGenFunction::emitCastLValue(const CastExpr *E) {
21012101 llvm_unreachable (" Unhandled lvalue cast kind?" );
21022102}
21032103
2104+ LValue CIRGenFunction::emitCXXTypeidLValue (const CXXTypeidExpr *E) {
2105+ assert (!cir::MissingFeatures::cxxTypeid () && " NYI" );
2106+ llvm_unreachable (" NYI" );
2107+ }
2108+
21042109// TODO(cir): candidate for common helper between LLVM and CIR codegen.
21052110static DeclRefExpr *tryToConvertMemberExprToDeclRefExpr (CIRGenFunction &CGF,
21062111 const MemberExpr *ME) {
@@ -2726,6 +2731,9 @@ LValue CIRGenFunction::emitLValue(const Expr *E) {
27262731 case Expr::MaterializeTemporaryExprClass:
27272732 return emitMaterializeTemporaryExpr (cast<MaterializeTemporaryExpr>(E));
27282733
2734+ case Expr::CXXTypeidExprClass:
2735+ return emitCXXTypeidLValue (cast<CXXTypeidExpr>(E));
2736+
27292737 case Expr::ObjCPropertyRefExprClass:
27302738 llvm_unreachable (" cannot emit a property reference directly" );
27312739 case Expr::StmtExprClass:
Original file line number Diff line number Diff line change @@ -1914,6 +1914,7 @@ class CIRGenFunction : public CIRGenTypeCache {
19141914 cir::CaseOpKind kind,
19151915 bool buildingTopLevelCase);
19161916 LValue emitCastLValue (const CastExpr *E);
1917+ LValue emitCXXTypeidLValue (const CXXTypeidExpr *E);
19171918
19181919 mlir::LogicalResult emitCaseStmt (const clang::CaseStmt &S,
19191920 mlir::Type condType,
You can’t perform that action at this time.
0 commit comments