restrict dyn_cast_or_null to pointer types, just like cast_or_null; re-commit of...