diff mbox

doc: is_int_type() returns false for SYM_RESTRICTs

Message ID 20180508224742.75558-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Luc Van Oostenryck May 8, 2018, 10:47 p.m. UTC
It isn't at all obvious that is_int_type() return false for
restricted/bitwise types. It's even quite counter-intuitive.

So document this.

Note: Fortunately, there isn't a lot of callers and the main
      callers are all in parse.c and are OK. OTOH, the callers
      in sparse-llvm.c are wrong and need another helper.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 symbol.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/symbol.h b/symbol.h
index 4edb44041..d6d3fe598 100644
--- a/symbol.h
+++ b/symbol.h
@@ -326,6 +326,11 @@  static inline struct symbol *get_base_type(const struct symbol *sym)
 	return examine_symbol_type(sym->ctype.base_type);
 }
 
+/*
+ * is_int_type() - test if @type is an integer type,
+ *	including enums & bitfields but excluding
+ *	restricted/bitwise integers.
+ */
 static inline int is_int_type(const struct symbol *type)
 {
 	if (type->type == SYM_NODE)