File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
mlir/lib/Dialect/StandardOps/IR Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -324,14 +324,11 @@ static LogicalResult verify(AllocLikeOp op) {
324324 return success ();
325325
326326 // An alloca op needs to have an ancestor with an allocation scope trait.
327- auto *parentOp = op.getParentOp ();
328- while (parentOp) {
329- if (parentOp->template hasTrait <OpTrait::AutomaticAllocationScope>())
330- return success ();
331- parentOp = parentOp->getParentOp ();
332- }
333- return op.emitOpError (
334- " requires an ancestor op with AutomaticAllocationScope trait" );
327+ if (!op.template getParentWithTrait <OpTrait::AutomaticAllocationScope>())
328+ return op.emitOpError (
329+ " requires an ancestor op with AutomaticAllocationScope trait" );
330+
331+ return success ();
335332}
336333
337334namespace {
You can’t perform that action at this time.
0 commit comments