This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Emit error for Altivec vector initializations when -faltivec-src-compat=gcc is specified
ClosedPublic

Authored by amyk on Jul 20 2021, 4:18 PM.

Details

Summary

Under the -faltivec-src-compat=gcc option, AltiVec vector initialization should be treated
as if they were compiled with gcc - which is, to emit an error when the vectors are initialized
in the parenthesized or non-parenthesized manner. This patch implements this behaviour.

Diff Detail

Event Timeline

amyk created this revision.Jul 20 2021, 4:18 PM
amyk requested review of this revision.Jul 20 2021, 4:18 PM
nemanjai accepted this revision.Jul 30 2021, 6:04 AM

Other than the naming nit, this LGTM.

clang/include/clang/Sema/Sema.h
6107

I think a more appropriate name here would be something like
CheckAltivecInitFromScalar()
Since this checks whether initialization of an Altivec vector type from a scalar is allowed. The fact that it is not allowed only if we have the GCC source compat option specified isn't really the important aspect to the caller - the caller only cares if it is OK to allow an initialization of an Altivec vector from a scalar.

This revision is now accepted and ready to land.Jul 30 2021, 6:04 AM
This revision was landed with ongoing or failed builds.Jul 30 2021, 7:36 AM
This revision was automatically updated to reflect the committed changes.
amyk marked an inline comment as done.Jul 30 2021, 8:54 AM