OSDN Git Service

compiler: Rewrite handling of untyped numeric constants.
[pf3gnuchains/gcc-fork.git] / gcc / go / gofrontend / types.h
index 72c42eb..edc46b7 100644 (file)
@@ -510,7 +510,8 @@ class Type
 
   // Verify the type.  This is called after parsing, and verifies that
   // types are complete and meet the language requirements.  This
-  // returns false if the type is invalid.
+  // returns false if the type is invalid and we should not continue
+  // traversing it.
   bool
   verify()
   { return this->do_verify(); }
@@ -679,6 +680,14 @@ class Type
   complex_type() const
   { return this->convert<const Complex_type, TYPE_COMPLEX>(); }
 
+  // Return whether this is a numeric type.
+  bool
+  is_numeric_type() const
+  {
+    Type_classification tc = this->base()->classification_;
+    return tc == TYPE_INTEGER || tc == TYPE_FLOAT || tc == TYPE_COMPLEX;
+  }
+
   // Return true if this is a boolean type.
   bool
   is_boolean_type() const