glsl2: Add a method for querying if an AST type has any qualifiers.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 29 Jun 2010 07:47:44 +0000 (00:47 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 29 Jun 2010 18:12:53 +0000 (11:12 -0700)
src/glsl/ast.h
src/glsl/ast_type.cpp

index de300e719c436f8b95d0324f4b176baa9b39450f..adb5fb11d471c495645336f441b09ef0152c8f93 100644 (file)
@@ -418,6 +418,7 @@ public:
 class ast_fully_specified_type : public ast_node {
 public:
    virtual void print(void) const;
+   bool has_qualifiers() const;
 
    ast_type_qualifier qualifier;
    ast_type_specifier *specifier;
index 49dfde20e97d1408f567fbc3c23d2c551b183d9c..e2510a10c62aca6490472a2c3f54b96f05b55a89 100644 (file)
@@ -110,3 +110,13 @@ ast_type_specifier::ast_type_specifier(int specifier)
 
    type_name = names[specifier];
 }
+
+bool
+ast_fully_specified_type::has_qualifiers() const
+{
+   return qualifier.invariant || qualifier.constant || qualifier.attribute
+                             || qualifier.varying || qualifier.in
+                             || qualifier.out || qualifier.centroid
+                             || qualifier.uniform || qualifier.smooth
+                             || qualifier.flat || qualifier.noperspective;
+}