[Patch, objc] maintenance, make Obj{C,C++} LTO-friendly.
IainS
developer@sandoe-acoustics.co.uk
Fri Jul 2 19:19:00 GMT 2010
This patch is intended to maintain the 'status-quo' in the presence of
LTO.
In fact, it is a general step forward in that I have identified the
reason that 'blanket' application of DECL_PRESERVE_P was required and
got rid of that.
There are places that I intended to round things out a bit more before
posting - but we are going to have major patch collisions with
Nathan's work and with resources being so limited, it seems better to
move forward in smaller steps - rather than spend all the time
counteracting bit-rot.
It's best viewed as general maintenance - with the side-effect that
LTO now works - so there's one fewer barriers to enabling that by
default on Darwin.
This has been tested on:
powerpc*-apple-darwin{8,9} i686-apple-darwin9, x86_64-apple-
darwin10, ?86*-unknown-linux-gnu, cris-elf (sim), s390x (compile
only), mipsisa64-elf(sim), armel-linux-eabi(compile-only).
OK for trunk?
Iain
objc/ChangeLog:
PR objc/44140
* objc-act.c: build_objc_string_decl() remove declaration.
(finish_var_decl): Remove forcing of var output and
indiscriminate ,marking as "Used".
(init_objc_symtab): Use integer_zero_node. Use
short_integer_type_node for the counts.
(generate_objc_symtab_decl): Remove call to
forward_declare_categories(). Attatch the
correct section designation to the symtab.
(init_module_descriptor): Make the filename "N/A" instead of "". Use
integer_zero_node
instead of building each time. DECL_PRESERVE_P this item.
(diagnose_missing_method): New.
(build_next_selector_translation_table): New.
(build_gnu_selector_translation_table): New.
(add_objc_string): Incorporate the code from build_objc_string_decl.
(build_objc_string_decl): Remove.
(objc_declare_alias): Use integer_zero_node.
(generate_category): Pass in the current class/category entry.
Ensure that we finish the variables we originally started, and keep
them so that they are
emitted. (generate_shared_structures): Pass in the current class/
category entry. Ensure
that we finish the variables we originally started so that they are
output.
(finish_objc): Reorder code so that we finish variables before
referencing them. Save the
global data before calling meta-daat creation routines, and pass the
current reference to the
two main routines. (generate_classref_translation_entry):
DECL_PRESERVE_P this item
it is needed by the runtime. (handle_class_ref): Use finish_var()
mark items as
DECL_PRESERVE_P where they are needed by the runtime.
(handle_impent): Use finish_var() mark items as DECL_PRESERVE_P
where they are
needed by the runtime. (generate_objc_image_info): Use
integer_zero_node, attatch the
correct section info. DECL_PRESERVE_P, this is needed by the runtime.
testsuite/Changelog:
PR objc/44140
objc.dg/lto: New.
objc.dg/lto/trivial-1_0.m: New.
objc.dg/lto/lto.exp: New.
obj-c++.dg/lto: New.
obj-c++.dg/lto/trivial-1_0.mm: New.
obj-c++.dg/lto/lto.exp: New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 161726-objc-lto-fix.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100702/e50accbb/attachment.txt>
-------------- next part --------------
More information about the Gcc-patches
mailing list