r600g: revert unintentional commit
[mesa.git] / src / glsl / ast_type.cpp
index 49dfde20e97d1408f567fbc3c23d2c551b183d9c..c680ae5f67123f326f3ccf41c6b112fa817b9c51 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
-#include <cstdio>
 #include "ast.h"
 extern "C" {
-#include "symbol_table.h"
+#include "program/symbol_table.h"
 }
 
 void
@@ -49,7 +48,8 @@ ast_type_specifier::print(void) const
 
 ast_type_specifier::ast_type_specifier(int specifier)
       : type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
-       is_array(false), array_size(NULL), precision(ast_precision_high)
+       is_array(false), array_size(NULL), precision(ast_precision_none),
+       is_precision_statement(false)
 {
    static const char *const names[] = {
       "void",
@@ -110,3 +110,29 @@ ast_type_specifier::ast_type_specifier(int specifier)
 
    type_name = names[specifier];
 }
+
+bool
+ast_fully_specified_type::has_qualifiers() const
+{
+   return this->qualifier.flags.i != 0;
+}
+
+bool ast_type_qualifier::has_interpolation() const
+{
+   return this->flags.q.smooth
+          || this->flags.q.flat
+          || this->flags.q.noperspective;
+}
+
+const char*
+ast_type_qualifier::interpolation_string() const
+{
+   if (this->flags.q.smooth)
+      return "smooth";
+   else if (this->flags.q.flat)
+      return "flat";
+   else if (this->flags.q.noperspective)
+      return "noperspective";
+   else
+      return NULL;
+}