#include "cfgloop.h"
#include "hosthooks.h"
#include "cgraph.h"
+#include "opts.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
int flag_pic;
+/* Nonzero if we are compiling position independent code for executable.
+ The value is 1 if we are doing "small" pic; value is 2 if we're doing
+ "large" pic. */
+
+int flag_pie;
+
+/* Nonzero if we are compiling code for a shared library, zero for
+ executable. */
+
+int flag_shlib;
+
/* Set to the default thread-local storage (tls) model to use. */
enum tls_model flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
{"pic", &flag_pic, 1,
N_("Generate position independent code, if possible") },
{"PIC", &flag_pic, 2, ""},
+ {"pie", &flag_pie, 1,
+ N_("Generate position independent code for executables, if possible") },
+ {"PIE", &flag_pie, 2, ""},
{"exceptions", &flag_exceptions, 1,
N_("Enable exception handling") },
{"unwind-tables", &flag_unwind_tables, 1,
#define DEFINE_LANG_NAME(NAME) { NULL, NAME },
-#include "options.h"
+#include "options_.h"
};
{
struct file_stack *fs;
- if (input_file_stack)
- input_file_stack->location = input_location;
-
fs = (struct file_stack *) xmalloc (sizeof (struct file_stack));
- input_filename = file;
- input_line = line;
fs->location = input_location;
fs->next = input_file_stack;
+ input_filename = file;
+ input_line = line;
input_file_stack = fs;
input_file_stack_tick++;
}
struct file_stack *fs;
fs = input_file_stack;
+ input_location = fs->location;
input_file_stack = fs->next;
free (fs);
input_file_stack_tick++;
-
- if (input_file_stack)
- input_location = input_file_stack->location;
- else
- {
- input_filename = NULL;
- input_line = 0;
- }
}
/* Compile an entire translation unit. Write a file of assembly
timevar_pop (TV_DUMP);
}
-#ifdef ASM_FILE_END
- ASM_FILE_END (asm_out_file);
-#endif
+ targetm.asm_out.file_end ();
/* 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
int toplev
#else
tree type ATTRIBUTE_UNUSED,
- int toplev ATTRIBUTE_UNUSED,
+ int toplev ATTRIBUTE_UNUSED
#endif
)
{
timevar_push (TV_REST_OF_COMPILATION);
+ /* Register rtl specific functions for cfg. */
+ rtl_register_cfg_hooks ();
+
/* Now that we're out of the frontend, we shouldn't have any more
CONCATs anywhere. */
generating_concat_p = 0;
timevar_pop (TV_JUMP);
- scope_to_insns_initialize ();
+ insn_locators_initialize ();
/* Complete generation of exception handling code. */
if (doing_eh (0))
{
static void
parse_options_and_default_flags (int argc, char **argv)
{
- int i;
+ int i, lang_mask;
/* Save in case md file wants to emit args as a comment. */
save_argc = argc;
init_ggc_heuristics();
/* Perform language-specific options initialization. */
- (*lang_hooks.init_options) ();
+ lang_mask = (*lang_hooks.init_options) ();
/* Scan to see what optimization level has been specified. That will
determine the default value of many flags. */
int indep_processed;
/* Give the language a chance to decode the option for itself. */
- lang_processed = (*lang_hooks.decode_option) (argc - i, argv + i);
+ lang_processed = handle_option (argc - i, argv + i, lang_mask);
if (lang_processed >= 0)
/* Now see if the option also has a language independent meaning.
}
}
+ if (flag_pie)
+ flag_pic = flag_pie;
+ if (flag_pic && !flag_pie)
+ flag_shlib = 1;
+
if (flag_no_inline == 2)
flag_no_inline = 0;
else
init_expr_once ();
expand_dummy_function_end ();
- /* Put an entry on the input file stack for the main input file. */
- push_srcloc (input_filename, 0);
-
/* If dbx symbol table desired, initialize writing it and output the
predefined types. */
timevar_push (TV_SYMOUT);