Open Quuxplusone opened 14 years ago
I have a partial fix for this on the parser-side, but because there are code
generation issues, I'm holding off a bit to confer with another Clang developer
who is working on the Altivec support in general.
Index: lib/Sema/SemaExpr.cpp
===================================================================
--- lib/Sema/SemaExpr.cpp (revision 107347)
+++ lib/Sema/SemaExpr.cpp (working copy)
@@ -5643,6 +5643,11 @@
if (vType.isNull())
return vType;
+ // If AltiVec, the comparison results in a numeric type, i.e.
+ // bool for C++, int for C
+ if (getLangOptions().AltiVec)
+ return (getLangOptions().CPlusPlus ? Context.BoolTy : Context.IntTy);
+
QualType lType = lex->getType();
QualType rType = rex->getType();
... Plus some tests.
Attached fix_for_7553.patch
(12946 bytes, text/plain): patch
fix_for_7553.patch
(12946 bytes, text/plain)