]> granicus.if.org Git - clang/commitdiff
Use static methods, which don't require an instance of OCUVectorType
authorChris Lattner <sabre@nondot.org>
Thu, 2 Aug 2007 22:20:00 +0000 (22:20 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 2 Aug 2007 22:20:00 +0000 (22:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40763 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp

index 20168b7840764c3c1bb463228ad0ecdefbd85266..cba95ca38df69a0c4d12b451c5c61b01df07e9d6 100644 (file)
@@ -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