[cfe-commits] r62443 - in /cfe/trunk: lib/AST/Expr.cpp test/CodeGen/ext-vector.c test/Coverage/c-language-features.inc
Nate Begeman
natebegeman at mac.com
Sat Jan 17 18:01:21 PST 2009
Author: sampo
Date: Sat Jan 17 20:01:21 2009
New Revision: 62443
URL: http://llvm.org/viewvc/llvm-project?rev=62443&view=rev
Log:
A couple more vector component access fixes.
Modified:
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/test/CodeGen/ext-vector.c
cfe/trunk/test/Coverage/c-language-features.inc
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=62443&r1=62442&r2=62443&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Sat Jan 17 20:01:21 2009
@@ -1160,6 +1160,17 @@
bool ExtVectorElementExpr::containsDuplicateElements() const {
const char *compStr = Accessor.getName();
unsigned length = Accessor.getLength();
+
+ // Halving swizzles do not contain duplicate elements.
+ if (!strcmp(compStr, "hi") || !strcmp(compStr, "lo") ||
+ !strcmp(compStr, "even") || !strcmp(compStr, "odd"))
+ return false;
+
+ // Advance past s-char prefix on hex swizzles.
+ if (*compStr == 's') {
+ compStr++;
+ length--;
+ }
for (unsigned i = 0; i != length-1; i++) {
const char *s = compStr+i;
Modified: cfe/trunk/test/CodeGen/ext-vector.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ext-vector.c?rev=62443&r1=62442&r2=62443&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/ext-vector.c (original)
+++ cfe/trunk/test/CodeGen/ext-vector.c Sat Jan 17 20:01:21 2009
@@ -15,7 +15,7 @@
float f;
void test2() {
- vec2 = vec4.rg; // shorten
+ vec2 = vec4.xy; // shorten
f = vec2.x; // extract elt
vec4 = vec4.yyyy; // splat
Modified: cfe/trunk/test/Coverage/c-language-features.inc
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/c-language-features.inc?rev=62443&r1=62442&r2=62443&view=diff
==============================================================================
--- cfe/trunk/test/Coverage/c-language-features.inc (original)
+++ cfe/trunk/test/Coverage/c-language-features.inc Sat Jan 17 20:01:21 2009
@@ -136,7 +136,7 @@
void f5() {
float4 t0 = (float4) { 0, 1, 2, 3 };
float4 t1 = t0;
- t0.lo.e = t1.hi.x;
+ t0.lo.even = t1.hi.x;
}
void f6() {
More information about the cfe-commits
mailing list