diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-01-18 01:47:54 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-01-18 01:47:54 +0000 |
commit | 353417af9d254d4fd0eb7d0a3ff71c4d8594ac58 (patch) | |
tree | 1713de9103f7426fa01d6883506c3505d4a79c67 /lib/AST/Expr.cpp | |
parent | ca0134259bd498b397c304a0f5b6a55bdaba05cc (diff) |
Update support for vector component access on ExtVectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 89cad41979..6540b2ccc3 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1173,12 +1173,15 @@ bool ExtVectorElementExpr::containsDuplicateElements() const { /// getEncodedElementAccess - We encode the fields as a llvm ConstantArray. void ExtVectorElementExpr::getEncodedElementAccess( llvm::SmallVectorImpl<unsigned> &Elts) const { - bool isHi = Accessor.isStr("hi"); - bool isLo = Accessor.isStr("lo"); - bool isEven = Accessor.isStr("e"); - bool isOdd = Accessor.isStr("o"); - const char *compStr = Accessor.getName(); + if (*compStr == 's') + compStr++; + + bool isHi = !strcmp(compStr, "hi"); + bool isLo = !strcmp(compStr, "lo"); + bool isEven = !strcmp(compStr, "even"); + bool isOdd = !strcmp(compStr, "odd"); + for (unsigned i = 0, e = getNumElements(); i != e; ++i) { uint64_t Index; |