This is an archive of the discontinued LLVM Phabricator instance.

Fix parsing of vector keyword in presence of conflicting uses.
ClosedPublic

Authored by jamieschmeiser on Apr 21 2021, 12:33 PM.

Details

Summary

When vector is found as a type or non-type id, check if it is really the altivec vector token.

Call TryAltiVecVectorToken when an identifier is seen in the parser before
annotating the token. This checks the next token where necessary to ensure
that vector is properly handled as the altivec token.

Diff Detail

Event Timeline

jamieschmeiser requested review of this revision.Apr 21 2021, 12:33 PM
jamieschmeiser created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 12:33 PM

Limit tests to platform that supports altivec.

ZarkoCA added inline comments.May 13 2021, 10:46 AM
clang/test/Parser/altivec-non-type-vector.c
2

Can you add tests for 64bit BE/LE linux and 32bit AIX/BE linux in this the subsequent test cases?

Expand testing.

ZarkoCA added inline comments.May 20 2021, 6:35 AM
clang/test/Parser/altivec-non-type-vector.c
2–25

Sorry, didn't mean to imply you needed all of these. These should suffice.

Remove unnecessary tests.

ZarkoCA accepted this revision.May 20 2021, 7:57 AM

LGTM, thanks.

This revision is now accepted and ready to land.May 20 2021, 7:57 AM