Hi, this is the 3rd version of the patch, the major change is to address Andrew’s concern on the documentation part.
I updated the documentation of this option as following:
'-finline-only-static'
By default, GCC inlines functions without considering whether they
are static or not. This flag guides inliner to only inline static
functions. This option has any effect only when inlining itself is
turned on by the -finline-functions or -finline-small-fiunctions.
Off by default.
all other changes keep the same as version 2.
please take a look again. and let me know any comment and suggestion.
thanks.
Qing
gcc/ChangeLog
+2018-09-18 Qing Zhao <[email protected]>
+
+ * cif-code.def (FUNCTION_EXTERN): New CIFCODE.
+ * common.opt (-finline-only-static): New option.
+ * doc/invoke.texi: Document -finline-only-static.
+ * ipa-inline.c (can_inline_edge_p): Control inlining based on
+ function's visibility.
gcc/testsuite/ChangeLog
+2018-09-18 Qing Zhao <[email protected]>
+
+ * gcc.dg/inline_only_static.c: New test.
+
New-inline-only-static.patch
Description: Binary data
