aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/objc-act.c26
-rw-r--r--gcc/objc/objc-lang.c3
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index fb3b79f..3dace91 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -60,6 +60,7 @@ Boston, MA 02111-1307, USA. */
#include "debug.h"
#include "target.h"
#include "diagnostic.h"
+#include "cgraph.h"
/* This is the default way of generating a method name. */
/* I am not sure it is really correct.
@@ -294,6 +295,7 @@ static void handle_class_ref PARAMS ((tree));
static void generate_struct_by_value_array PARAMS ((void))
ATTRIBUTE_NORETURN;
static void encode_complete_bitfield PARAMS ((int, tree, int));
+static void mark_referenced_methods PARAMS ((void));
/*** Private Interface (data) ***/
@@ -486,6 +488,7 @@ objc_init (filename)
void
finish_file ()
{
+ mark_referenced_methods ();
c_objc_common_finish_file ();
/* Finalize Objective-C runtime data. No need to generate tables
@@ -4028,6 +4031,29 @@ generate_dispatch_table (type, name, size, list)
}
static void
+mark_referenced_methods ()
+{
+ struct imp_entry *impent;
+ tree chain;
+
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ chain = CLASS_CLS_METHODS (impent->imp_context);
+ while (chain)
+ {
+ cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
+ chain = TREE_CHAIN (chain);
+ }
+ chain = CLASS_NST_METHODS (impent->imp_context);
+ while (chain)
+ {
+ cgraph_mark_needed_node (cgraph_node (METHOD_DEFINITION (chain)));
+ chain = TREE_CHAIN (chain);
+ }
+ }
+}
+
+static void
generate_dispatch_tables ()
{
tree initlist, chain, method_list_template;
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index ff17f0f..686e35e 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -99,6 +99,9 @@ static void objc_init_options PARAMS ((void));
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
c_convert_parm_for_inlining
+#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
+#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body
+
#undef LANG_HOOKS_TYPE_FOR_MODE
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
#undef LANG_HOOKS_TYPE_FOR_SIZE