This is an archive of the discontinued LLVM Phabricator instance.

Add element-type to the Vector TypeLoc types.
ClosedPublic

Authored by erichkeane on Dec 17 2020, 12:15 PM.

Details

Summary

As shown by bug 48540, GCC vector types would cause a crash when the
declaration hada ParenType. This was because the walking of the
declaration would try to expand the 'inner' type, but there was no
ability to get it from the vector type. This patch adds that element
type access to the vector type loc objects.

Diff Detail

Event Timeline

erichkeane requested review of this revision.Dec 17 2020, 12:15 PM
erichkeane created this revision.
fhahn added inline comments.Jan 5 2021, 6:34 AM
clang/include/clang/AST/TypeLoc.h
1756

Can we reuse/unify this with MatrixTypeLoc? And then have MatrixTypeLoc just deal with the row/column operands.

erichkeane added inline comments.Jan 5 2021, 9:15 AM
clang/include/clang/AST/TypeLoc.h
1756

Since these have to be ConcreteTypeLocs, I don't think the matrix type can directly inherit from it, but it can do something very similar.

fhahn accepted this revision.Jan 7 2021, 7:48 AM

LGTM, thanks

clang/include/clang/AST/TypeLoc.h
1756

Oh right, that's a shame, given there already is a MatrixTypeLoc, which essentially does the same thing, but it also carries locations for the row and column operands.

This revision is now accepted and ready to land.Jan 7 2021, 7:48 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2021, 9:14 AM