This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Make Type::isVectorTy call isa<VectorType>
ClosedPublic

Authored by ctetreau on Apr 3 2020, 12:12 PM.

Diff Detail

Event Timeline

ctetreau created this revision.Apr 3 2020, 12:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2020, 12:12 PM

This will fail to compile if someone includes Type.h without including DerivedTypes.h.

ctetreau updated this revision to Diff 254914.Apr 3 2020, 2:09 PM

address code reveiw issues

This will fail to compile if someone includes Type.h without including DerivedTypes.h.

Right you are. I guess I didn't notice because in practice everybody includes DerivedType. I changed it to work like the old vector getters.

I actually wanted to get rid of this function too, but there are literally thousands of usages of it...

efriedma accepted this revision.Apr 3 2020, 6:05 PM

LGTM

This revision is now accepted and ready to land.Apr 3 2020, 6:05 PM
ctetreau updated this revision to Diff 256375.Apr 9 2020, 1:15 PM

rebase such that this depends on no other changes

This revision was automatically updated to reflect the committed changes.

What's the motivation for this change compared to the previous code? This looks problematic in ways I can't really see a fix for. While the originally proposed patch would fail to compile if you included Type.h without DerivedType.h - the new version will compile but fail to link (a & probably should fail to compile - it will if you compile with -Wundefined-inline)