[TableGen] Don't convert types to strings to query what they are. Just use 'isa'