summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/AST/Expr.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/AST/Expr.cpp b/clang/AST/Expr.cpp
index 20168b78407..cba95ca38df 100644
--- a/clang/AST/Expr.cpp
+++ b/clang/AST/Expr.cpp
@@ -588,11 +588,13 @@ bool Expr::isNullPointerConstant(ASTContext &Ctx) const {
OCUVectorComponent::ComponentType OCUVectorComponent::getComponentType() const {
// derive the component type, no need to waste space.
const char *compStr = Accessor.getName();
- const OCUVectorType *VT = getType()->getAsOCUVectorType();
- if (VT->isPointAccessor(*compStr)) return Point;
- if (VT->isColorAccessor(*compStr)) return Color;
- if (VT->isTextureAccessor(*compStr)) return Texture;
- assert(0 && "getComponentType(): Illegal accessor");
+
+ if (OCUVectorType::isPointAccessor(*compStr)) return Point;
+ if (OCUVectorType::isColorAccessor(*compStr)) return Color;
+
+ assert(OCUVectorType::isTextureAccessor(*compStr) &&
+ "getComponentType(): Illegal accessor");
+ return Texture;
}
/// containsDuplicateComponents - Return true if any element access is
OpenPOWER on IntegriCloud