summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-03 21:10:11 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-03 21:10:11 +0000
commit7bfefa9d2c82e804ef4e59772f4060ac325bf99a (patch)
tree3a9882bd235e5026410e5397a5e46a97ece50b48 /gcc/toplev.c
parent7271d48ec9cd1a9aa3893d1d95e1d4a1c5882c37 (diff)
downloadgcc-7bfefa9d2c82e804ef4e59772f4060ac325bf99a.tar.gz
Merge lto branch into trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 4dd17e4b0c8..8686e4dd947 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -198,6 +198,17 @@ int optimize = 0;
int optimize_size = 0;
+/* True if this is the lto front end. This is used to disable
+ gimple generation and lowering passes that are normally run on the
+ output of a front end. These passes must be bypassed for lto since
+ they have already been done before the gimple was written. */
+
+bool in_lto_p = false;
+
+/* Nonzero if we should write GIMPLE bytecode for link-time optimization. */
+
+int flag_generate_lto;
+
/* The FUNCTION_DECL for the function currently being compiled,
or 0 if between functions. */
tree current_function_decl;
@@ -1087,6 +1098,14 @@ compile_file (void)
/* Flush any pending external directives. */
process_pending_assemble_externals ();
+ /* Emit LTO marker if LTO info has been previously emitted. This is
+ used by collect2 to determine whether an object file contains IL.
+ We used to emit an undefined reference here, but this produces
+ link errors if an object file with IL is stored into a shared
+ library without invoking lto1. */
+ if (flag_generate_lto)
+ fprintf (asm_out_file,"\t.comm\tgnu_lto_v1,1,1\n");
+
/* Attach a special .ident directive to the end of the file to identify
the version of GCC which compiled this code. The format of the .ident
string is patterned after the ones produced by native SVR4 compilers. */
@@ -2344,6 +2363,8 @@ finalize (void)
fatal_error ("error writing to %s: %m", asm_file_name);
if (fclose (asm_out_file) != 0)
fatal_error ("error closing %s: %m", asm_file_name);
+ if (flag_wpa)
+ unlink_if_ordinary (asm_file_name);
}
statistics_fini ();