tqchen opened a new pull request, #19856: URL: https://github.com/apache/tvm/pull/19856
This PR phases out the legacy `Downcast` helper and removes `tvm/ir/cast.h`, replacing mandatory object casts with the strict `as_or_throw` style APIs after bumping tvm-ffi to the latest fix. The migration keeps nullable-object behavior explicit. Optional `Any` conversions that need to preserve null use the nullable `value_or(nullptr).as_or_throw<ffi::Optional<T>>()` pattern, while simple mandatory casts use direct receivers such as `obj.as_or_throw<T>()`. Validation: - `git diff --check` passed. - File-scoped `pre-commit run --files ...` passed. - `rg -n "\bDowncast\b|tvm/ir/cast\.h" include src tests/cpp apps -g'*.h' -g'*.cc' -g'*.cpp' -g'*.hpp'` produced no matches. - Remaining parenthesized simple-token `as_or_throw` matches are only intentional nullable `value_or(nullptr)` sites. - `ninja -C build -j$(nproc)` passed. - `./build/cpptest` passed 120/120. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
