From: epetrich Date: Thu, 10 May 2007 05:29:03 +0000 (+0000) Subject: * src/SDCCast.c (createFunction): also generate non-inlined version of X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=87d2359e512012240447c483c999f32292ff264a;p=fw%2Fsdcc * src/SDCCast.c (createFunction): also generate non-inlined version of function for functions declared as "static inline" * src/SDCCast.c (fixupInline, inlineAddDecl): reset symbol state so function can be inlined after non-inlined version generated. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4801 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index c487f8a2..2d3ba146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-10 Erik Petrich + + * src/SDCCast.c (createFunction): also generate non-inlined version of + function for functions declared as "static inline" + * src/SDCCast.c (fixupInline, inlineAddDecl): reset symbol state so + function can be inlined after non-inlined version generated. + 2007-05-10 Borut Razem * support/scripts/gen_known_bugs.pl: added script diff --git a/src/SDCCast.c b/src/SDCCast.c index 9c929bd9..d48f3c00 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -5954,6 +5954,10 @@ fixupInline (ast * tree, int level) sym->level = level; sym->block = currBlockno; + sym->reqv = NULL; + SYM_SPIL_LOC (sym) = NULL; + sym->key = 0; + /* If the symbol is a label, we need to renumber it */ if (sym->islbl) fixupInlineLabel (sym); @@ -6023,6 +6027,9 @@ fixupInline (ast * tree, int level) static void inlineAddDecl (symbol * sym, ast * block, int addSymTab) { + sym->reqv = NULL; + SYM_SPIL_LOC (sym) = NULL; + sym->key = 0; if (block != NULL) { symbol **decl = &(block->values.sym); @@ -6383,9 +6390,16 @@ createFunction (symbol * name, ast * body) if (fatalError) goto skipall; - /* Do not generate code for inline functions unless extern also */ + /* Do not generate code for inline functions unless extern also. */ +#if 0 if (FUNC_ISINLINE (name->type) && !IS_EXTERN (fetype)) goto skipall; +#else + /* Temporary hack: always generate code for static inline functions. */ + /* Ideally static inline functions should only be generated if needed. */ + if (FUNC_ISINLINE (name->type) && !IS_EXTERN (fetype) && !IS_STATIC (fetype)) + goto skipall; +#endif /* create the node & generate intermediate code */ GcurMemmap = code;