Use static methods, which don't require an instance of OCUVectorType

llvm-svn: 40763
This commit is contained in:
Chris Lattner 2007-08-02 22:20:00 +00:00
parent 585afabddd
commit f1cb1c8d70
1 changed files with 7 additions and 5 deletions

View 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