summaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/gofrontend/types.h')
-rw-r--r--gcc/go/gofrontend/types.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h
index 3fe80488a49..edc46b72073 100644
--- a/gcc/go/gofrontend/types.h
+++ b/gcc/go/gofrontend/types.h
@@ -680,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