Skip to content
Commit e4628b79 authored by River Riddle's avatar River Riddle Committed by Mehdi Amini
Browse files

Add new utilities for RTTI Operation casting: dyn_cast_or_null and isa_nonnull

    * dyn_cast_or_null
      - This will first check if the operation is null before trying to 'dyn_cast':

        Value *v = ...;
        if (auto forOp = dyn_cast_or_null<AffineForOp>(v->getDefiningOp()))
          ...
    * isa_nonnull
      - This will first check if the pointer is null before trying to 'isa':

        Value *v = ...;
        if (isa_nonnull<AffineForOp>(v->getDefiningOp());
          ...

--

PiperOrigin-RevId: 242171343
parent 4cda344e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment