Skip to content

Commit caae6cc

Browse files
committed
Make diagnostics more specific
1 parent 08d8c69 commit caae6cc

File tree

1 file changed

+47
-33
lines changed

1 file changed

+47
-33
lines changed

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
160160
return cgf.emitCoawaitExpr(*s).getValue();
161161
}
162162
mlir::Value VisitCoyieldExpr(CoyieldExpr *e) {
163-
cgf.cgm.errorNYI(e->getSourceRange(), "coyield expr");
163+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: coyield");
164164
return {};
165165
}
166166
mlir::Value VisitUnaryCoawait(const UnaryOperator *e) {
167-
cgf.cgm.errorNYI(e->getSourceRange(), "unary coawait expr");
167+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: unary coawait");
168168
return {};
169169
}
170170

@@ -207,7 +207,8 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
207207
}
208208

209209
mlir::Value VisitFixedPointLiteral(const FixedPointLiteral *e) {
210-
cgf.cgm.errorNYI(e->getSourceRange(), "fixed point literal");
210+
cgf.cgm.errorNYI(e->getSourceRange(),
211+
"ScalarExprEmitter: fixed point literal");
211212
return {};
212213
}
213214

@@ -243,15 +244,16 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
243244
mlir::Value VisitOffsetOfExpr(OffsetOfExpr *e);
244245

245246
mlir::Value VisitSizeOfPackExpr(SizeOfPackExpr *e) {
246-
cgf.cgm.errorNYI(e->getSourceRange(), "size of pack expr");
247+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: size of pack");
247248
return {};
248249
}
249250
mlir::Value VisitPseudoObjectExpr(PseudoObjectExpr *e) {
250-
cgf.cgm.errorNYI(e->getSourceRange(), "pseudo object expr");
251+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: pseudo object");
251252
return {};
252253
}
253254
mlir::Value VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *e) {
254-
cgf.cgm.errorNYI(e->getSourceRange(), "sycl unique stable name expr");
255+
cgf.cgm.errorNYI(e->getSourceRange(),
256+
"ScalarExprEmitter: sycl unique stable name");
255257
return {};
256258
}
257259

@@ -265,32 +267,34 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
265267
}
266268

267269
mlir::Value VisitObjCSelectorExpr(ObjCSelectorExpr *e) {
268-
cgf.cgm.errorNYI(e->getSourceRange(), "objc selector expr");
270+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: objc selector");
269271
return {};
270272
}
271273
mlir::Value VisitObjCProtocolExpr(ObjCProtocolExpr *e) {
272-
cgf.cgm.errorNYI(e->getSourceRange(), "objc protocol expr");
274+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: objc protocol");
273275
return {};
274276
}
275277
mlir::Value VisitObjCIVarRefExpr(ObjCIvarRefExpr *e) {
276-
cgf.cgm.errorNYI(e->getSourceRange(), "objc ivar ref expr");
278+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: objc ivar ref");
277279
return {};
278280
}
279281
mlir::Value VisitObjCMessageExpr(ObjCMessageExpr *e) {
280-
cgf.cgm.errorNYI(e->getSourceRange(), "objc message expr");
282+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: objc message");
281283
return {};
282284
}
283285
mlir::Value VisitObjCIsaExpr(ObjCIsaExpr *e) {
284-
cgf.cgm.errorNYI(e->getSourceRange(), "objc isa expr");
286+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: objc isa");
285287
return {};
286288
}
287289
mlir::Value VisitObjCAvailabilityCheckExpr(ObjCAvailabilityCheckExpr *e) {
288-
cgf.cgm.errorNYI(e->getSourceRange(), "objc availability check expr");
290+
cgf.cgm.errorNYI(e->getSourceRange(),
291+
"ScalarExprEmitter: objc availability check");
289292
return {};
290293
}
291294

292295
mlir::Value VisitMatrixSubscriptExpr(MatrixSubscriptExpr *e) {
293-
cgf.cgm.errorNYI(e->getSourceRange(), "matrix subscript expr");
296+
cgf.cgm.errorNYI(e->getSourceRange(),
297+
"ScalarExprEmitter: matrix subscript");
294298
return {};
295299
}
296300

@@ -376,12 +380,14 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
376380
mlir::Value VisitInitListExpr(InitListExpr *e);
377381

378382
mlir::Value VisitArrayInitIndexExpr(ArrayInitIndexExpr *e) {
379-
cgf.cgm.errorNYI(e->getSourceRange(), "array init index expr");
383+
cgf.cgm.errorNYI(e->getSourceRange(),
384+
"ScalarExprEmitter: array init index");
380385
return {};
381386
}
382387

383388
mlir::Value VisitImplicitValueInitExpr(const ImplicitValueInitExpr *e) {
384-
cgf.cgm.errorNYI(e->getSourceRange(), "implicit value init expr");
389+
cgf.cgm.errorNYI(e->getSourceRange(),
390+
"ScalarExprEmitter: implicit value init");
385391
return {};
386392
}
387393

@@ -794,11 +800,12 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
794800

795801
// C++
796802
mlir::Value VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *e) {
797-
cgf.cgm.errorNYI(e->getSourceRange(), "materialize temporary expr");
803+
cgf.cgm.errorNYI(e->getSourceRange(),
804+
"ScalarExprEmitter: materialize temporary");
798805
return {};
799806
}
800807
mlir::Value VisitSourceLocExpr(SourceLocExpr *e) {
801-
cgf.cgm.errorNYI(e->getSourceRange(), "source loc expr");
808+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: source loc");
802809
return {};
803810
}
804811
mlir::Value VisitCXXDefaultArgExpr(CXXDefaultArgExpr *dae) {
@@ -821,36 +828,40 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
821828
return {};
822829
}
823830
mlir::Value VisitTypeTraitExpr(const TypeTraitExpr *e) {
824-
cgf.cgm.errorNYI(e->getSourceRange(), "type trait expr");
831+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: type trait");
825832
return {};
826833
}
827834
mlir::Value
828835
VisitConceptSpecializationExpr(const ConceptSpecializationExpr *e) {
829-
cgf.cgm.errorNYI(e->getSourceRange(), "concept specialization expr");
836+
cgf.cgm.errorNYI(e->getSourceRange(),
837+
"ScalarExprEmitter: concept specialization");
830838
return {};
831839
}
832840
mlir::Value VisitRequiresExpr(const RequiresExpr *e) {
833-
cgf.cgm.errorNYI(e->getSourceRange(), "requires expr");
841+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: requires");
834842
return {};
835843
}
836844
mlir::Value VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *e) {
837-
cgf.cgm.errorNYI(e->getSourceRange(), "array type trait expr");
845+
cgf.cgm.errorNYI(e->getSourceRange(),
846+
"ScalarExprEmitter: array type trait");
838847
return {};
839848
}
840849
mlir::Value VisitExpressionTraitExpr(const ExpressionTraitExpr *e) {
841-
cgf.cgm.errorNYI(e->getSourceRange(), "expression trait expr");
850+
cgf.cgm.errorNYI(e->getSourceRange(),
851+
"ScalarExprEmitter: expression trait");
842852
return {};
843853
}
844854
mlir::Value VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *e) {
845-
cgf.cgm.errorNYI(e->getSourceRange(), "cxx pseudo destructor expr");
855+
cgf.cgm.errorNYI(e->getSourceRange(),
856+
"ScalarExprEmitter: cxx pseudo destructor");
846857
return {};
847858
}
848859
mlir::Value VisitCXXThrowExpr(const CXXThrowExpr *e) {
849860
cgf.emitCXXThrowExpr(e);
850861
return {};
851862
}
852863
mlir::Value VisitCXXNoexceptExpr(CXXNoexceptExpr *e) {
853-
cgf.cgm.errorNYI(e->getSourceRange(), "cxx noexcept expr");
864+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: cxx noexcept");
854865
return {};
855866
}
856867

@@ -1317,45 +1328,48 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
13171328
}
13181329

13191330
mlir::Value VisitBinPtrMemD(const BinaryOperator *e) {
1320-
cgf.cgm.errorNYI(e->getSourceRange(), "ptr mem d expr");
1331+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: ptr mem d");
13211332
return {};
13221333
}
13231334

13241335
mlir::Value VisitBinPtrMemI(const BinaryOperator *e) {
1325-
cgf.cgm.errorNYI(e->getSourceRange(), "ptr mem i expr");
1336+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: ptr mem i");
13261337
return {};
13271338
}
13281339

13291340
// Other Operators.
13301341
mlir::Value VisitBlockExpr(const BlockExpr *e) {
1331-
cgf.cgm.errorNYI(e->getSourceRange(), "block expr");
1342+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: block");
13321343
return {};
13331344
}
13341345

13351346
mlir::Value VisitChooseExpr(ChooseExpr *e) {
1336-
cgf.cgm.errorNYI(e->getSourceRange(), "choose expr");
1347+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: choose");
13371348
return {};
13381349
}
13391350

13401351
mlir::Value VisitObjCStringLiteral(const ObjCStringLiteral *e) {
1341-
cgf.cgm.errorNYI(e->getSourceRange(), "objc string literal");
1352+
cgf.cgm.errorNYI(e->getSourceRange(),
1353+
"ScalarExprEmitter: objc string literal");
13421354
return {};
13431355
}
13441356
mlir::Value VisitObjCBoxedExpr(ObjCBoxedExpr *e) {
1345-
cgf.cgm.errorNYI(e->getSourceRange(), "objc boxed expr");
1357+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: objc boxed");
13461358
return {};
13471359
}
13481360
mlir::Value VisitObjCArrayLiteral(ObjCArrayLiteral *e) {
1349-
cgf.cgm.errorNYI(e->getSourceRange(), "objc array literal");
1361+
cgf.cgm.errorNYI(e->getSourceRange(),
1362+
"ScalarExprEmitter: objc array literal");
13501363
return {};
13511364
}
13521365
mlir::Value VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *e) {
1353-
cgf.cgm.errorNYI(e->getSourceRange(), "objc dictionary literal");
1366+
cgf.cgm.errorNYI(e->getSourceRange(),
1367+
"ScalarExprEmitter: objc dictionary literal");
13541368
return {};
13551369
}
13561370

13571371
mlir::Value VisitAsTypeExpr(AsTypeExpr *e) {
1358-
cgf.cgm.errorNYI(e->getSourceRange(), "as type expr");
1372+
cgf.cgm.errorNYI(e->getSourceRange(), "ScalarExprEmitter: as type");
13591373
return {};
13601374
}
13611375

0 commit comments

Comments
 (0)