/* Functions for generic Darwin as target machine for GNU C compiler.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004,
- 2005
+ 2005, 2006, 2007
Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
#include "tm_p.h"
#include "toplev.h"
#include "hashtab.h"
+#include "df.h"
/* Darwin supports a feature called fix-and-continue, which is used
for rapid turn around debugging. When code is compiled with the
{
#if defined (TARGET_TOC)
/* Create a new register for CSE opportunities. */
- rtx hi_reg = (no_new_pseudos ? reg : gen_reg_rtx (Pmode));
+ rtx hi_reg = (!can_create_pseudo_p () ? reg : gen_reg_rtx (Pmode));
emit_insn (gen_macho_high (hi_reg, orig));
emit_insn (gen_macho_low (reg, hi_reg, orig));
#else
#endif
#if defined (TARGET_TOC) /* i.e., PowerPC */
- rtx hi_sum_reg = (no_new_pseudos ? reg : gen_reg_rtx (Pmode));
+ rtx hi_sum_reg = (!can_create_pseudo_p ()
+ ? reg
+ : gen_reg_rtx (Pmode));
gcc_assert (reg);
|| GET_CODE (XEXP (orig, 0)) == LABEL_REF))
{
#if defined (TARGET_TOC) /* ppc */
- rtx temp_reg = (no_new_pseudos) ? reg : gen_reg_rtx (Pmode);
+ rtx temp_reg = (!can_create_pseudo_p ()
+ ? reg :
+ gen_reg_rtx (Pmode));
rtx asym = XEXP (orig, 0);
rtx mem;
#if defined (TARGET_TOC) /* i.e., PowerPC */
/* Generating a new reg may expose opportunities for
common subexpression elimination. */
- rtx hi_sum_reg = no_new_pseudos ? reg : gen_reg_rtx (Pmode);
+ rtx hi_sum_reg = (!can_create_pseudo_p ()
+ ? reg
+ : gen_reg_rtx (Pmode));
rtx mem;
rtx insn;
rtx sum;
gen_rtx_LO_SUM (Pmode,
hi_sum_reg, offset));
insn = emit_insn (gen_rtx_SET (VOIDmode, reg, mem));
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, pic_ref,
- REG_NOTES (insn));
+ set_unique_reg_note (insn, REG_EQUAL, pic_ref);
pic_ref = reg;
#else
#endif
if (reload_in_progress)
- regs_ever_live[REGNO (pic)] = 1;
+ df_set_regs_ever_live (REGNO (pic), true);
pic_ref = gen_rtx_PLUS (Pmode, pic,
gen_pic_offset (XEXP (orig, 0),
pic_base));
pic_offset_table_rtx));
#endif
if (reload_in_progress)
- regs_ever_live[REGNO (pic)] = 1;
+ df_set_regs_ever_live (REGNO (pic), true);
pic_ref = gen_rtx_PLUS (Pmode,
pic,
gen_pic_offset (orig, pic_base));
return readonly_data_section;
}
+int
+machopic_reloc_rw_mask (void)
+{
+ return MACHOPIC_INDIRECT ? 3 : 0;
+}
+
section *
machopic_select_section (tree decl,
int reloc,
&& (lookup_attribute ("weak", DECL_ATTRIBUTES (decl))
|| ! lookup_attribute ("weak_import",
DECL_ATTRIBUTES (decl))));
- int shlib = flag_pic;
section *base_section;
- switch (categorize_decl_for_section (decl, reloc, shlib))
+ switch (categorize_decl_for_section (decl, reloc))
{
case SECCAT_TEXT:
base_section = darwin_text_section (reloc, weak);
/* APPLE KEXT stuff -- only applies with pure static C++ code. */
if (! TARGET_KEXTABI)
{
- warning (0, "%<%s%> 2.95 vtable-compatability attribute applies "
+ warning (0, "%<%s%> 2.95 vtable-compatibility attribute applies "
"only when compiling a kext", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
}
else if (TREE_CODE (*node) != RECORD_TYPE)
{
- warning (0, "%<%s%> 2.95 vtable-compatability attribute applies "
+ warning (0, "%<%s%> 2.95 vtable-compatibility attribute applies "
"only to C++ classes", IDENTIFIER_POINTER (name));
*no_add_attrs = true;
void
darwin_override_options (void)
{
- if (flag_apple_kext && strcmp (lang_hooks.name, "GNU C++") != 0)
- {
- warning (0, "command line option %<-fapple-kext%> is only valid for C++");
- flag_apple_kext = 0;
- }
if (flag_mkernel || flag_apple_kext)
{
/* -mkernel implies -fapple-kext for C++ */
/* No -fnon-call-exceptions data in kexts. */
flag_non_call_exceptions = 0;
}
+ if (flag_var_tracking
+ && strverscmp (darwin_macosx_version_min, "10.5") >= 0)
+ flag_var_tracking_uninit = 1;
}
#include "gt-darwin.h"