-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[CIR][NFC] Add stubs for missing visitors in ScalarExprEmitter #171222
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
This adds stubs that issue NYI errors for any visitor that is present in the ClangIR incubator but missing in the upstream implementation. This will make it easier to find to correct locations to implement missing functionality.
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clangir Author: Andy Kaylor (andykaylor) ChangesThis adds stubs that issue NYI errors for any visitor that is present in the ClangIR incubator but missing in the upstream implementation. This will make it easier to find to correct locations to implement missing functionality. Full diff: https://github.com/llvm/llvm-project/pull/171222.diff 1 Files Affected:
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
index 9043ecab42f15..26c46cb336449 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
@@ -159,6 +159,14 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
mlir::Value VisitCoawaitExpr(CoawaitExpr *s) {
return cgf.emitCoawaitExpr(*s).getValue();
}
+ mlir::Value VisitCoyieldExpr(CoyieldExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "coyield expr");
+ return {};
+ }
+ mlir::Value VisitUnaryCoawait(const UnaryOperator *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "unary coawait expr");
+ return {};
+ }
mlir::Value emitLoadOfLValue(LValue lv, SourceLocation loc) {
return cgf.emitLoadOfLValue(lv, loc).getValue();
@@ -198,6 +206,11 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
cir::IntAttr::get(type, e->getValue()));
}
+ mlir::Value VisitFixedPointLiteral(const FixedPointLiteral *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "fixed point literal");
+ return {};
+ }
+
mlir::Value VisitFloatingLiteral(const FloatingLiteral *e) {
mlir::Type type = cgf.convertType(e->getType());
assert(mlir::isa<cir::FPTypeInterface>(type) &&
@@ -229,6 +242,19 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
mlir::Value VisitOffsetOfExpr(OffsetOfExpr *e);
+ mlir::Value VisitSizeOfPackExpr(SizeOfPackExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "size of pack expr");
+ return {};
+ }
+ mlir::Value VisitPseudoObjectExpr(PseudoObjectExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "pseudo object expr");
+ return {};
+ }
+ mlir::Value VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "sycl unique stable name expr");
+ return {};
+ }
+
mlir::Value VisitOpaqueValueExpr(OpaqueValueExpr *e) {
if (e->isGLValue())
return emitLoadOfLValue(cgf.getOrCreateOpaqueLValueMapping(e),
@@ -238,6 +264,36 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
return cgf.getOrCreateOpaqueRValueMapping(e).getValue();
}
+ mlir::Value VisitObjCSelectorExpr(ObjCSelectorExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc selector expr");
+ return {};
+ }
+ mlir::Value VisitObjCProtocolExpr(ObjCProtocolExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc protocol expr");
+ return {};
+ }
+ mlir::Value VisitObjCIVarRefExpr(ObjCIvarRefExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc ivar ref expr");
+ return {};
+ }
+ mlir::Value VisitObjCMessageExpr(ObjCMessageExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc message expr");
+ return {};
+ }
+ mlir::Value VisitObjCIsaExpr(ObjCIsaExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc isa expr");
+ return {};
+ }
+ mlir::Value VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc availability check expr");
+ return {};
+ }
+
+ mlir::Value VisitMatrixSubscriptExpr(MatrixSubscriptExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "matrix subscript expr");
+ return {};
+ }
+
mlir::Value VisitCastExpr(CastExpr *e);
mlir::Value VisitCallExpr(const CallExpr *e);
@@ -319,6 +375,16 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
mlir::Value VisitInitListExpr(InitListExpr *e);
+ mlir::Value VisitArrayInitIndexExpr(ArrayInitIndexExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "array init index expr");
+ return {};
+ }
+
+ mlir::Value VisitImplicitValueInitExpr(const ImplicitValueInitExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "implicit value init expr");
+ return {};
+ }
+
mlir::Value VisitExplicitCastExpr(ExplicitCastExpr *e) {
return VisitCastExpr(e);
}
@@ -726,6 +792,15 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
return Visit(e->getSubExpr());
}
+ // C++
+ mlir::Value VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "materialize temporary expr");
+ return {};
+ }
+ mlir::Value VisitSourceLocExpr(SourceLocExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "source loc expr");
+ return {};
+ }
mlir::Value VisitCXXDefaultArgExpr(CXXDefaultArgExpr *dae) {
CIRGenFunction::CXXDefaultArgExprScope scope(cgf, dae);
return Visit(dae->getExpr());
@@ -745,11 +820,39 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
cgf.emitCXXDeleteExpr(e);
return {};
}
-
+ mlir::Value VisitTypeTraitExpr(const TypeTraitExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "type trait expr");
+ return {};
+ }
+ mlir::Value
+ VisitConceptSpecializationExpr(const ConceptSpecializationExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "concept specialization expr");
+ return {};
+ }
+ mlir::Value VisitRequiresExpr(const RequiresExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "requires expr");
+ return {};
+ }
+ mlir::Value VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "array type trait expr");
+ return {};
+ }
+ mlir::Value VisitExpressionTraitExpr(const ExpressionTraitExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "expression trait expr");
+ return {};
+ }
+ mlir::Value VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "cxx pseudo destructor expr");
+ return {};
+ }
mlir::Value VisitCXXThrowExpr(const CXXThrowExpr *e) {
cgf.emitCXXThrowExpr(e);
return {};
}
+ mlir::Value VisitCXXNoexceptExpr(CXXNoexceptExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "cxx noexcept expr");
+ return {};
+ }
/// Emit a conversion from the specified type to the specified destination
/// type, both of which are CIR scalar types.
@@ -1213,6 +1316,49 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
return maybePromoteBoolResult(resOp.getResult(), resTy);
}
+ mlir::Value VisitBinPtrMemD(const BinaryOperator *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "ptr mem d expr");
+ return {};
+ }
+
+ mlir::Value VisitBinPtrMemI(const BinaryOperator *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "ptr mem i expr");
+ return {};
+ }
+
+ // Other Operators.
+ mlir::Value VisitBlockExpr(const BlockExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "block expr");
+ return {};
+ }
+
+ mlir::Value VisitChooseExpr(ChooseExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "choose expr");
+ return {};
+ }
+
+ mlir::Value VisitObjCStringLiteral(const ObjCStringLiteral *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc string literal");
+ return {};
+ }
+ mlir::Value VisitObjCBoxedExpr(ObjCBoxedExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc boxed expr");
+ return {};
+ }
+ mlir::Value VisitObjCArrayLiteral(ObjCArrayLiteral *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc array literal");
+ return {};
+ }
+ mlir::Value VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "objc dictionary literal");
+ return {};
+ }
+
+ mlir::Value VisitAsTypeExpr(AsTypeExpr *e) {
+ cgf.cgm.errorNYI(e->getSourceRange(), "as type expr");
+ return {};
+ }
+
mlir::Value VisitAtomicExpr(AtomicExpr *e) {
return cgf.emitAtomicExpr(e).getValue();
}
|
AmrDeveloper
left a comment
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, I was thinking, should we prefix the message with the emitter name to make it easy to find the place, because some of them are NYI in the Complex emitter too 🤔, for example
"ScalarExprEmitter: CopeIdExpe"
This adds stubs that issue NYI errors for any visitor that is present in the ClangIR incubator but missing in the upstream implementation. This will make it easier to find to correct locations to implement missing functionality.