/* Functions for generic Darwin as target machine for GNU C compiler.
- Copyright (C) 1989-2017 Free Software Foundation, Inc.
+ Copyright (C) 1989-2019 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GCC.
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define IN_TARGET_CODE 1
+
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "langhooks.h"
#include "toplev.h"
#include "lto-section-names.h"
+#include "intl.h"
/* Darwin supports a feature called fix-and-continue, which is used
for rapid turn around debugging. When code is compiled with the
/* First handle a simple SYMBOL_REF or LABEL_REF */
if (GET_CODE (orig) == LABEL_REF
- || (GET_CODE (orig) == SYMBOL_REF
- ))
+ || GET_CODE (orig) == SYMBOL_REF)
{
/* addr(foo) = &func+(foo-func) */
orig = machopic_indirect_data_reference (orig, reg);
return pic_ref;
}
}
-
- else if (GET_CODE (orig) == SYMBOL_REF)
- return orig;
-
else if (GET_CODE (orig) == PLUS
&& (GET_CODE (XEXP (orig, 0)) == MEM
|| GET_CODE (XEXP (orig, 0)) == SYMBOL_REF
}
/* Likewise, should we set special REG_NOTEs here? */
}
-
else if (GET_CODE (orig) == CONST)
{
return machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg);
}
-
else if (GET_CODE (orig) == MEM
&& GET_CODE (XEXP (orig, 0)) == SYMBOL_REF)
{
in darwin_end_file. */
static FILE *lto_asm_out_file, *saved_asm_out_file;
static char *lto_asm_out_name;
+static enum debug_info_levels saved_debug_info_level;
/* Prepare asm_out_file for LTO output. For darwin, this means hiding
asm_out_file and switching to an alternative output file. */
{
gcc_assert (! saved_asm_out_file);
saved_asm_out_file = asm_out_file;
+ saved_debug_info_level = debug_info_level;
+ debug_info_level = DINFO_LEVEL_NONE;
if (! lto_asm_out_name)
lto_asm_out_name = make_temp_file (".lto.s");
lto_asm_out_file = fopen (lto_asm_out_name, "a");
fclose (lto_asm_out_file);
asm_out_file = saved_asm_out_file;
saved_asm_out_file = NULL;
+ debug_info_level = saved_debug_info_level;
}
static void
if (!global_options_set.x_dwarf_version)
dwarf_version = 2;
+ if (global_options_set.x_dwarf_split_debug_info)
+ {
+ inform (input_location,
+ "%<-gsplit-dwarf%> is not supported on this platform, ignored");
+ dwarf_split_debug_info = 0;
+ global_options_set.x_dwarf_split_debug_info = 0;
+ }
+
/* Do not allow unwind tables to be generated by default for m32.
fnon-call-exceptions will override this, regardless of what we do. */
if (generating_for_darwin_version < 10
&& !global_options_set.x_flag_asynchronous_unwind_tables)))
{
inform (input_location,
- "-freorder-blocks-and-partition does not work with exceptions "
- "on this architecture");
+ "%<-freorder-blocks-and-partition%> does not work with "
+ "exceptions on this architecture");
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
for (l = 0; l < length; l++)
if (!s[l] || !isascii (s[l]))
{
- warning (darwin_warn_nonportable_cfstrings, "%s in CFString literal",
- s[l] ? "non-ASCII character" : "embedded NUL");
+ warning (darwin_warn_nonportable_cfstrings,
+ s[l] ? G_("non-ASCII character in CFString literal")
+ : G_("embedded NUL in CFString literal"));
break;
}
}
: text_section;
}
-/* When a function is partitioned between sections, we need to insert a label
- at the start of each new chunk - so that it may become a valid 'atom' for
- eh and debug purposes. Without this the linker will emit warnings if one
- tries to add line location information (since the switched fragment will
- be anonymous). */
-
-void
-darwin_function_switched_text_sections (FILE *fp, tree decl, bool new_is_cold)
-{
- /* Make sure we pick up all the relevant quotes etc. */
- assemble_name_raw (fp, new_is_cold ? "__cold_sect_of_" : "__hot_sect_of_");
- assemble_name_raw (fp, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- fputs (":\n", fp);
-}
-
#include "gt-darwin.h"