gcc/objc/ * objc-act.c (objc_write_global_declarations): Adjust comment. * objc-gnu-runtime-abi-01.c (build_selector_table_decl): Set TREE_USED bit.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 718fdf0..3528c89 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -439,8 +439,7 @@ objc_init (void) return true; } -/* This is called automatically (at the very end of compilation) by - c_write_global_declarations and cp_write_global_declarations. */ +/* This is called at the end of parsing by the C/C++ parsers. */ void objc_write_global_declarations (void) { diff --git a/gcc/objc/objc-gnu-runtime-abi-01.c b/gcc/objc/objc-gnu-runtime-abi-01.c index b096fb9..cdf77b2 100644 --- a/gcc/objc/objc-gnu-runtime-abi-01.c +++ b/gcc/objc/objc-gnu-runtime-abi-01.c @@ -500,6 +500,8 @@ build_selector_table_decl (void) temp = build_array_type (objc_selector_template, NULL_TREE); UOBJC_SELECTOR_TABLE_decl = start_var_decl (temp, "_OBJC_SELECTOR_TABLE"); + /* Squash `defined but not used' warning check_global_declaration. */ + TREE_USED (UOBJC_SELECTOR_TABLE_decl) = 1; OBJCMETA (UOBJC_SELECTOR_TABLE_decl, objc_meta, meta_base); }