[llvm-commits] [llvm-gcc-4.2] r54201 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386.c config/rs6000/rs6000.c objc/objc-act.c
Bill Wendling
isanbard at gmail.com
Tue Jul 29 23:24:39 PDT 2008
Author: void
Date: Wed Jul 30 01:24:39 2008
New Revision: 54201
URL: http://llvm.org/viewvc/llvm-project?rev=54201&view=rev
Log:
Merges from Apple's GCC 4.2 r148430
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=54201&r1=54200&r2=54201&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Wed Jul 30 01:24:39 2008
@@ -63,6 +63,10 @@
#include "c-tree.h"
#include "c-common.h"
/* APPLE LOCAL end regparmandstackparm */
+/* APPLE LOCAL begin dwarf call/pop 5221468 */
+#include "debug.h"
+#include "dwarf2out.h"
+/* APPLE LOCAL end dwarf call/pop 5221468 */
#ifndef CHECK_STACK_LIMIT
#define CHECK_STACK_LIMIT (-1)
@@ -1330,13 +1334,6 @@
#define TARGET_ENCODE_SECTION_INFO SUBTARGET_ENCODE_SECTION_INFO
#endif
- /* APPLE LOCAL begin mainline 2005-07-31 */
-#ifdef SUBTARGET_ENCODE_SECTION_INFO
-#undef TARGET_ENCODE_SECTION_INFO
-#define TARGET_ENCODE_SECTION_INFO SUBTARGET_ENCODE_SECTION_INFO
-#endif
-
- /* APPLE LOCAL end mainline 2005-07-31 */
#undef TARGET_ASM_OPEN_PAREN
#define TARGET_ASM_OPEN_PAREN ""
#undef TARGET_ASM_CLOSE_PAREN
@@ -1440,10 +1437,6 @@
#define TARGET_INTERNAL_ARG_POINTER ix86_internal_arg_pointer
#undef TARGET_DWARF_HANDLE_FRAME_UNSPEC
#define TARGET_DWARF_HANDLE_FRAME_UNSPEC ix86_dwarf_handle_frame_unspec
-/* LLVM LOCAL begin mainline */
-#undef TARGET_STRICT_ARGUMENT_NAMING
-#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
-/* LLVM LOCAL end mainline */
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg
@@ -2011,6 +2004,8 @@
/* APPLE LOCAL begin mainline */
if (TARGET_64BIT)
{
+ if (TARGET_ALIGN_DOUBLE)
+ error ("-malign-double makes no sense in the 64bit mode");
if (TARGET_RTD)
error ("-mrtd calling convention not supported in the 64bit mode");
/* APPLE LOCAL begin radar 4877693 */
@@ -5346,7 +5341,29 @@
if (!flag_pic)
output_asm_insn ("mov{l}\t{%2, %0|%0, %2}", xops);
else
- output_asm_insn ("call\t%a2", xops);
+ /* APPLE LOCAL begin dwarf call/pop 5221468 */
+ {
+ output_asm_insn ("call\t%a2", xops);
+
+ /* If necessary, report the effect that the instruction has on
+ the unwind info. */
+#if defined (DWARF2_UNWIND_INFO)
+ if (flag_asynchronous_unwind_tables
+#if !defined (HAVE_prologue)
+ && !ACCUMULATE_OUTGOING_ARGS
+#endif
+ && dwarf2out_do_frame ())
+ {
+ rtx insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ GEN_INT (-4)));
+ insn = make_insn_raw (insn);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ dwarf2out_frame_debug (insn, true);
+ }
+#endif
+ }
+ /* APPLE LOCAL end dwarf call/pop 5221468 */
#if TARGET_MACHO
/* Output the Mach-O "canonical" label name ("Lxx$pb") here too. This
@@ -5359,7 +5376,30 @@
CODE_LABEL_NUMBER (XEXP (xops[2], 0)));
if (flag_pic)
- output_asm_insn ("pop{l}\t%0", xops);
+ /* APPLE LOCAL begin dwarf call/pop 5221468 */
+ {
+ output_asm_insn ("pop{l}\t%0", xops);
+
+ /* If necessary, report the effect that the instruction has on
+ the unwind info. We've already done this for delay slots
+ and call instructions. */
+#if defined (DWARF2_UNWIND_INFO)
+ if (flag_asynchronous_unwind_tables
+#if !defined (HAVE_prologue)
+ && !ACCUMULATE_OUTGOING_ARGS
+#endif
+ && dwarf2out_do_frame ())
+ {
+ rtx insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ GEN_INT (4)));
+ insn = make_insn_raw (insn);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ dwarf2out_frame_debug (insn, true);
+ }
+#endif
+ }
+ /* APPLE LOCAL end dwarf call/pop 5221468 */
}
else
{
@@ -7778,15 +7818,13 @@
break;
case SYMBOL_REF:
- /* APPLE LOCAL axe stubs 5571540 */
+ /* APPLE LOCAL begin axe stubs 5571540 */
if (! TARGET_MACHO ||
- /* LLVM LOCAL begin */
#if TARGET_MACHO
- /* darwin_stubs not available on non-Darwin systems */
! darwin_stubs ||
#endif
- /* LLVM LOCAL end */
TARGET_64BIT)
+ /* APPLE LOCAL end axe stubs 5571540 */
output_addr_const (file, x);
else
{
@@ -21840,8 +21878,13 @@
else if (IDENTIFIER_POINTER (arg)[1] == 'x')
mode = SFmode;
else if (IDENTIFIER_POINTER (arg)[1] == 'm')
- /* LLVM LOCAL - Force MMX to use a vector mode: PR1222. */
+ /* LLVM LOCAL - begin Force MMX to use a vector mode: PR1222. */
+#ifdef ENABLE_LLVM
mode = V2SImode;
+#else
+ mode = SFmode;
+#endif
+ /* LLVM LOCAL - end Force MMX to use a vector mode: PR1222. */
if (mode != VOIDmode)
type = lang_hooks.types.type_for_mode (mode, 1);
@@ -21919,7 +21962,9 @@
&& TREE_STATIC (v)
/* APPLE LOCAL begin LLVM */
/* DECL_RTL is not set for LLVM */
-/* && MEM_P (DECL_RTL (v))*/
+#ifndef ENABLE_LLVM
+ && MEM_P (DECL_RTL (v))
+#endif
)
/* APPLE LOCAL end LLVM */
{
@@ -21934,7 +21979,9 @@
&& TREE_STATIC (v)
/* APPLE LOCAL begin LLVM */
/* DECL_RTL is not set for LLVM */
-/* && MEM_P (DECL_RTL (v))*/
+#ifndef ENABLE_LLVM
+ && MEM_P (DECL_RTL (v))
+#endif
)
/* APPLE LOCAL end LLVM */
{
@@ -22840,8 +22887,8 @@
}
-/* APPLE LOCAL begin LLVM */
-
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
/* These are wrappers for type_natural_mode and examine_argument which are
both static functions. */
enum machine_mode ix86_getNaturalModeForType(tree type) {
@@ -22858,8 +22905,7 @@
int bit_offset) {
return classify_argument(mode, type, classes, bit_offset);
}
-
-
-/* APPLE LOCAL end LLVM */
+#endif
+/* LLVM LOCAL end */
#include "gt-i386.h"
Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=54201&r1=54200&r2=54201&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Wed Jul 30 01:24:39 2008
@@ -1227,11 +1227,19 @@
rs6000_altivec_abi = 1;
TARGET_ALTIVEC_VRSAVE = 1;
+ /* APPLE LOCAL begin ARM 5683689 */
+ if (!darwin_macosx_version_min && !darwin_iphoneos_version_min)
+ darwin_macosx_version_min = "10.1";
+ /* APPLE LOCAL end ARM 5683689 */
+
+ /* APPLE LOCAL begin ARM 5683689 */
/* APPLE LOCAL begin constant cfstrings */
if (darwin_constant_cfstrings < 0)
- darwin_constant_cfstrings = (strverscmp (darwin_macosx_version_min, "10.2")
- >= 0);
+ darwin_constant_cfstrings =
+ darwin_iphoneos_version_min
+ || (strverscmp (darwin_macosx_version_min, "10.2") >= 0);
/* APPLE LOCAL end constant cfstrings */
+ /* APPLE LOCAL end ARM 5683689 */
if (DEFAULT_ABI == ABI_DARWIN)
{
@@ -1273,6 +1281,8 @@
G4 unless targetting the kernel. */
if (!flag_mkernel
&& !flag_apple_kext
+ /* APPLE LOCAL ARM 5683689 */
+ && darwin_macosx_version_min
&& strverscmp (darwin_macosx_version_min, "10.5") >= 0
&& ! (target_flags_explicit & MASK_ALTIVEC)
&& ! rs6000_select[1].string)
Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=54201&r1=54200&r2=54201&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Jul 30 01:24:39 2008
@@ -714,6 +714,11 @@
bool
objc_init (void)
{
+/* APPLE LOCAL begin ARM 5726269 */
+#ifdef OBJC_TARGET_FLAG_OBJC_ABI
+ OBJC_TARGET_FLAG_OBJC_ABI;
+#endif
+/* APPLE LOCAL end ARM 5726269 */
/* APPLE LOCAL radar 4862848 */
OBJC_FLAG_OBJC_ABI;
/* APPLE LOCAL begin radar 4531086 */
@@ -746,12 +751,18 @@
if (flag_next_runtime)
{
+ /* APPLE LOCAL begin ARM hybrid objc-2.0 */
+ bool use_hybrid_msgSend = (flag_objc_abi == 2
+ && flag_objc_legacy_dispatch);
TAG_GETCLASS = "objc_getClass";
TAG_GETMETACLASS = "objc_getMetaClass";
TAG_MSGSEND = "objc_msgSend";
- TAG_MSGSENDSUPER = "objc_msgSendSuper";
+ TAG_MSGSENDSUPER = use_hybrid_msgSend ? "objc_msgSendSuper2"
+ : "objc_msgSendSuper";
TAG_MSGSEND_STRET = "objc_msgSend_stret";
- TAG_MSGSENDSUPER_STRET = "objc_msgSendSuper_stret";
+ TAG_MSGSENDSUPER_STRET = use_hybrid_msgSend ? "objc_msgSendSuper2_stret"
+ : "objc_msgSendSuper_stret";
+ /* APPLE LOCAL end ARM hybrid objc-2.0 */
default_constant_string_class_name = "NSConstantString";
/* APPLE LOCAL begin radar 4810609 */
if (flag_objc_gc_only)
@@ -759,14 +770,11 @@
/* APPLE LOCAL end radar 4810609 */
/* APPLE LOCAL begin radar 4949034 */
#ifdef OBJCPLUS
- if (flag_objc_abi == 2)
- {
- /* In objc2 abi -fobjc-call-cxx-cdtors in on by default. */
- if (flag_objc_call_cxx_cdtors == -1)
- flag_objc_call_cxx_cdtors = 1;
- }
- else if (flag_objc_call_cxx_cdtors == -1)
- flag_objc_call_cxx_cdtors = 0;
+ /* APPLE LOCAL begin radar 5809596 */
+ /* For all objc ABIs -fobjc-call-cxx-cdtors is on by default. */
+ if (flag_objc_call_cxx_cdtors == -1)
+ flag_objc_call_cxx_cdtors = 1;
+ /* APPLE LOCAL end radar 5809596 */
#endif
/* APPLE LOCAL end radar 4949034 */
}
@@ -3479,6 +3487,13 @@
-3 Comparison (LTYP and RTYP may match in either direction);
-4 Silent comparison (for C++ overload resolution).
-5 Comparison of ivar and @synthesized property type
+ // APPLE LOCAL begin radar 5218071
+ -6 Comparison of two property types; RTYP is type of property
+ in 'base' and LTYP is property type in derived class. They
+ match if LTYP is more specialized than RTYP; this includes
+ when RTYP is 'id' or LTYP is an object derived from an object
+ of RTYP.
+ // APPLE LOCAL end radar 5218071
APPLE LOCAL end 4175534 */
bool
@@ -4383,7 +4398,8 @@
NULL, NULL_TREE);
/* APPLE LOCAL begin ObjC new abi */
- if (flag_objc_abi == 2)
+ /* APPLE LOCAL ARM hybrid objc-2.0 */
+ if (flag_objc_abi == 2 && !flag_objc_legacy_dispatch)
{
/* APPLE LOCAL radar 4699834 */
/* Removed _rtp suffix from objc_msgSend_fixup_rtp and variants */
@@ -4727,6 +4743,20 @@
len1));
}
+/* APPLE LOCAL begin radar 5982789 */
+/* This routine build "NSString" type if "NSString" class is declared
+ in scope where it is needed. */
+static tree buildNSStringType(void)
+{
+ tree NSString_decl;
+
+ NSString_decl = objc_is_class_name (get_identifier ("NSString"));
+ if (!NSString_decl)
+ return NULL_TREE;
+ return objc_get_protocol_qualified_type (NSString_decl, NULL_TREE);
+}
+/* APPLE LOCAL end radar 5982789 */
+
/* Given a chain of STRING_CST's, build a static instance of
NXConstantString which points at the concatenation of those
strings. We place the string object in the __string_objects
@@ -4753,10 +4783,15 @@
ObjC string literal. On Darwin (Mac OS X), for example,
we may wish to obtain a constant CFString reference instead. */
constructor = (*targetm.construct_objc_string) (string);
- /* APPLE LOCAL begin radar 4494634 */
+ /* APPLE LOCAL begin radar 4494634, 5982789 */
if (constructor)
- return build1 (NOP_EXPR, objc_object_type, constructor);
- /* APPLE LOCAL end radar 4494634 */
+ {
+ tree NSStringPtrType = buildNSStringType();
+ return build1 (NOP_EXPR,
+ NSStringPtrType ? build_pointer_type (NSStringPtrType)
+ : objc_object_type, constructor);
+ }
+ /* APPLE LOCAL end radar 4494634, 5982789 */
/* APPLE LOCAL end constant cfstrings */
/* Check whether the string class being used actually exists and has the
@@ -12846,6 +12881,8 @@
/* Selector type - will eventually change to `int'. */
/* APPLE LOCAL begin ObjC new abi */
chainon (arglist, build_tree_list (NULL_TREE, flag_objc_abi == 2
+ /* APPLE LOCAL ARM hybrid objc-2.0 */
+ && !flag_objc_legacy_dispatch
? (superflag
? objc_v2_super_selector_type
: objc_v2_selector_type)
@@ -13393,7 +13430,8 @@
/* APPLE LOCAL ObjC new abi */
/* Code moved down */
/* APPLE LOCAL begin ObjC new abi */
- if (flag_objc_abi == 2)
+ /* APPLE LOCAL ARM hybrid objc-2.0 */
+ if (flag_objc_abi == 2 && !flag_objc_legacy_dispatch)
{
tree ret_type;
tree message_func_decl;
@@ -17181,8 +17219,6 @@
else if (code == ARRAY_TYPE)
encode_array (type, curtype, format);
- else if (code == POINTER_TYPE)
- encode_pointer (type, curtype, format);
/* APPLE LOCAL begin radar 4476365 */
#ifdef OBJCPLUS
else if (code == REFERENCE_TYPE)
@@ -17190,6 +17226,10 @@
#endif
/* APPLE LOCAL end radar 4476365 */
+ /* APPLE LOCAL radar 5849129 */
+ else if (code == POINTER_TYPE || code == BLOCK_POINTER_TYPE)
+ encode_pointer (type, curtype, format);
+
else if (code == RECORD_TYPE || code == UNION_TYPE || code == ENUMERAL_TYPE)
encode_aggregate (type, curtype, format);
@@ -19595,14 +19635,13 @@
bool
objc_check_nsstring_pointer_type (tree type)
{
- tree NSString_decl, NSString_type;
+ tree NSString_type;
if (TREE_CODE (type) != POINTER_TYPE)
return false;
- NSString_decl = objc_is_class_name (get_identifier ("NSString"));
- if (!NSString_decl)
+ NSString_type = buildNSStringType();
+ if (!NSString_type)
return false;
- NSString_type = objc_get_protocol_qualified_type (NSString_decl, NULL_TREE);
return (TYPE_MAIN_VARIANT (TREE_TYPE (type)) == NSString_type);
}
More information about the llvm-commits
mailing list