From 8cf99394ee4c08a3ede8ef52cd0b3ce73afcf076 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Fri, 10 Jul 2009 11:19:22 -0700 Subject: move extern inline function to file scope In gcc extern inline function has special meaning. The inline function will never emit stand alone copy of the function. It also allow multiple implementations cross different file. That effectively makes the extern inline has file scope. Signed-off-by: Christopher Li --- symbol.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'symbol.h') diff --git a/symbol.h b/symbol.h index 751dec1..42d69d6 100644 --- a/symbol.h +++ b/symbol.h @@ -340,6 +340,18 @@ static inline int is_void_type(struct symbol *type) return type == &void_ctype; } +static inline int is_function(struct symbol *type) +{ + return type && type->type == SYM_FN; +} + +static inline int is_extern_inline(struct symbol *sym) +{ + return (sym->ctype.modifiers & MOD_EXTERN) && + (sym->ctype.modifiers & MOD_INLINE) && + is_function(sym->ctype.base_type); +} + static inline int get_sym_type(struct symbol *type) { if (type->type == SYM_NODE) -- cgit v1.2.3-65-gdbad