diff mbox

[4/7] add is_array_type()

Message ID 20170322173257.63019-5-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck March 22, 2017, 5:32 p.m. UTC
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 symbol.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/symbol.h b/symbol.h
index ee17ba643..512a2f69f 100644
--- a/symbol.h
+++ b/symbol.h
@@ -354,6 +354,13 @@  static inline int is_func_type(struct symbol *type)
 	return type->type == SYM_FN;
 }
 
+static inline int is_array_type(struct symbol *type)
+{
+	if (type->type == SYM_NODE)
+		type = type->ctype.base_type;
+	return type->type == SYM_ARRAY;
+}
+
 static inline int is_float_type(struct symbol *type)
 {
 	if (type->type == SYM_NODE)