forked from OSchip/llvm-project
add OCUVectorComponent::getNumComponents()
llvm-svn: 40778
This commit is contained in:
parent
a1036f9155
commit
177bd450e0
|
@ -583,6 +583,11 @@ bool Expr::isNullPointerConstant(ASTContext &Ctx) const {
|
||||||
return isIntegerConstantExpr(Val, Ctx, 0, true) && Val == 0;
|
return isIntegerConstantExpr(Val, Ctx, 0, true) && Val == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned OCUVectorComponent::getNumComponents() const {
|
||||||
|
return strlen(Accessor.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// getComponentType - Determine whether the components of this access are
|
/// getComponentType - Determine whether the components of this access are
|
||||||
/// "point" "color" or "texture" elements.
|
/// "point" "color" or "texture" elements.
|
||||||
OCUVectorComponent::ComponentType OCUVectorComponent::getComponentType() const {
|
OCUVectorComponent::ComponentType OCUVectorComponent::getComponentType() const {
|
||||||
|
@ -615,7 +620,7 @@ bool OCUVectorComponent::containsDuplicateComponents() const {
|
||||||
/// getEncodedElementAccess - We encode fields with two bits per component.
|
/// getEncodedElementAccess - We encode fields with two bits per component.
|
||||||
unsigned OCUVectorComponent::getEncodedElementAccess() const {
|
unsigned OCUVectorComponent::getEncodedElementAccess() const {
|
||||||
const char *compStr = Accessor.getName();
|
const char *compStr = Accessor.getName();
|
||||||
unsigned length = strlen(compStr);
|
unsigned length = getNumComponents();
|
||||||
|
|
||||||
unsigned Result = 0;
|
unsigned Result = 0;
|
||||||
|
|
||||||
|
|
|
@ -486,6 +486,9 @@ public:
|
||||||
|
|
||||||
IdentifierInfo &getAccessor() const { return Accessor; }
|
IdentifierInfo &getAccessor() const { return Accessor; }
|
||||||
|
|
||||||
|
/// getNumComponents - Get the number of components being selected.
|
||||||
|
unsigned getNumComponents() const;
|
||||||
|
|
||||||
/// getComponentType - Determine whether the components of this access are
|
/// getComponentType - Determine whether the components of this access are
|
||||||
/// "point" "color" or "texture" elements.
|
/// "point" "color" or "texture" elements.
|
||||||
ComponentType getComponentType() const;
|
ComponentType getComponentType() const;
|
||||||
|
|
Loading…
Reference in New Issue