@@ -410,7 +410,7 @@ struct TosaValidation : public tosa::impl::TosaValidationBase<TosaValidation> {
410
410
411
411
SmallVector<std::function<LogicalResult(Operation *)>> const_checkers;
412
412
tosa_level_t tosa_level;
413
- DenseMap<const mlir:: StringAttr * , mlir::Type> variables_map;
413
+ DenseMap<StringAttr, mlir::Type> variables_map;
414
414
};
415
415
416
416
LogicalResult TosaValidation::applyLevelCheck (Operation *op) {
@@ -448,15 +448,15 @@ bool TosaValidation::CheckVariable(Operation *op) {
448
448
if (isa<mlir::tosa::VariableOp>(op)) {
449
449
auto name_attr = cast<mlir::StringAttr>(op->getAttr (" name" ));
450
450
451
- if (variables_map.count (& name_attr)) {
451
+ if (variables_map.count (name_attr)) {
452
452
op->emitOpError () << " name has already been declared" ;
453
453
return false ;
454
454
}
455
455
456
456
auto type_attr = cast<mlir::TypeAttr>(op->getAttr (" type" ));
457
457
mlir::Type type = type_attr.getValue ();
458
458
459
- variables_map[& name_attr] = type;
459
+ variables_map[name_attr] = type;
460
460
}
461
461
462
462
return true ;
@@ -467,12 +467,12 @@ bool TosaValidation::CheckVariableReadOrWrite(Operation *op) {
467
467
isa<mlir::tosa::VariableWriteOp>(op)) {
468
468
auto name_attr = cast<mlir::StringAttr>(op->getAttr (" name" ));
469
469
470
- if (!variables_map.count (& name_attr)) {
470
+ if (!variables_map.count (name_attr)) {
471
471
op->emitOpError () << " name has not been declared" ;
472
472
return false ;
473
473
}
474
474
475
- auto var_type = variables_map[& name_attr];
475
+ auto var_type = variables_map[name_attr];
476
476
477
477
for (auto v : op->getOperands ()) {
478
478
auto type = v.getType ();
0 commit comments