[llvm-commits] [llvm-gcc-4.2] r56322 - in /llvm-gcc-4.2/trunk: ./ gcc/ gcc/config/ gcc/config/arm/ gcc/config/i386/ gcc/cp/ gcc/objc/
Bill Wendling
isanbard at gmail.com
Thu Sep 18 17:07:06 PDT 2008
Author: void
Date: Thu Sep 18 19:07:05 2008
New Revision: 56322
URL: http://llvm.org/viewvc/llvm-project?rev=56322&view=rev
Log:
Sync to Apple's GCC r150950. This brings in:
- Many more blocks fixes.
- Generate objc2 metadata with 'l' label.
- Fix objc warnings.
Modified:
llvm-gcc-4.2/trunk/ChangeLog.apple
llvm-gcc-4.2/trunk/build_gcc
llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/c-common.c
llvm-gcc-4.2/trunk/gcc/c-common.h
llvm-gcc-4.2/trunk/gcc/c-decl.c
llvm-gcc-4.2/trunk/gcc/c-gimplify.c
llvm-gcc-4.2/trunk/gcc/c-parser.c
llvm-gcc-4.2/trunk/gcc/c-pragma.c
llvm-gcc-4.2/trunk/gcc/c-typeck.c
llvm-gcc-4.2/trunk/gcc/calls.c
llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
llvm-gcc-4.2/trunk/gcc/config/darwin-c.c
llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def
llvm-gcc-4.2/trunk/gcc/config/darwin.c
llvm-gcc-4.2/trunk/gcc/config/darwin.h
llvm-gcc-4.2/trunk/gcc/config/i386/i386.c
llvm-gcc-4.2/trunk/gcc/config/i386/xmmintrin.h
llvm-gcc-4.2/trunk/gcc/cp/ChangeLog
llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h
llvm-gcc-4.2/trunk/gcc/cp/decl.c
llvm-gcc-4.2/trunk/gcc/cp/decl2.c
llvm-gcc-4.2/trunk/gcc/cp/lex.c
llvm-gcc-4.2/trunk/gcc/cp/parser.c
llvm-gcc-4.2/trunk/gcc/cp/pt.c
llvm-gcc-4.2/trunk/gcc/cp/rtti.c
llvm-gcc-4.2/trunk/gcc/cp/search.c
llvm-gcc-4.2/trunk/gcc/cp/semantics.c
llvm-gcc-4.2/trunk/gcc/cp/typeck.c
llvm-gcc-4.2/trunk/gcc/dwarf2out.c
llvm-gcc-4.2/trunk/gcc/dwarf2out.h
llvm-gcc-4.2/trunk/gcc/final.c
llvm-gcc-4.2/trunk/gcc/function.c
llvm-gcc-4.2/trunk/gcc/global.c
llvm-gcc-4.2/trunk/gcc/libgcc2.c
llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
llvm-gcc-4.2/trunk/gcc/reload1.c
llvm-gcc-4.2/trunk/gcc/rtl.h
llvm-gcc-4.2/trunk/gcc/sched-deps.c
llvm-gcc-4.2/trunk/gcc/tree-ssa-alias.c
llvm-gcc-4.2/trunk/gcc/tree.h
llvm-gcc-4.2/trunk/gcc/version.c
Modified: llvm-gcc-4.2/trunk/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/ChangeLog.apple?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/ChangeLog.apple Thu Sep 18 19:07:05 2008
@@ -1,3 +1,15 @@
+2008-09-05 Josh Conner <jconner at apple.com>
+
+ Radar 6177003
+ * build_gcc: Add support for LANGUAGES.
+
+2008-09-03 Josh Conner <jconner at apple.com>
+
+ Radar 6156214
+ * build_gcc (ARM_CONFIGFLAGS): On ARM, Configure
+ --with-build-sysroot instead of --with-sysroot.
+ * build_libgcc (ARM_CONFIGFLAGS): Likewise.
+
2008-08-25 Josh Conner <jconner at apple.com>
Radar 6162685
Modified: llvm-gcc-4.2/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/build_gcc (original)
+++ llvm-gcc-4.2/trunk/build_gcc Thu Sep 18 19:07:05 2008
@@ -29,6 +29,10 @@
bootstrap=--disable-bootstrap
fi
+# Language front-ends to build. This also affects
+# whether the C++ driver and driver-driver are installed
+LANGUAGES=${LANGUAGES-c,objc,c++,obj-c++}
+
# The B&I build srcript (~rc/bin/buildit) accepts an '-othercflags'
# command-line flag, and captures the argument to that flag in
# $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
@@ -108,7 +112,7 @@
# For ARM, grab all system files from an SDK.
ARM_SYSROOT="/Developer/SDKs/Extra"
ARM_LIBSTDCXX_VERSION=4.2.1
-ARM_CONFIGFLAGS="--with-sysroot=\"$ARM_SYSROOT\" \
+ARM_CONFIGFLAGS="--with-build-sysroot=\"$ARM_SYSROOT\" \
--with-gxx-include-dir=\${prefix}/include/c++/$ARM_LIBSTDCXX_VERSION"
# APPLE LOCAL end ARM ARM_CONFIGFLAGS
@@ -157,7 +161,7 @@
CONFIGFLAGS="$CHECKING_FLAGS \
--prefix=$DEST_ROOT \
--mandir=\${prefix}/share/man \
- --enable-languages=c,objc,c++,obj-c++ \
+ --enable-languages=$LANGUAGES \
--program-prefix=llvm- \
--program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
--with-gxx-include-dir=/usr/include/c++/$LIBSTDCXX_VERSION \
@@ -187,6 +191,17 @@
# The $LOCAL_MAKEFLAGS variable can be used to override $MAKEFLAGS.
MAKEFLAGS=${LOCAL_MAKEFLAGS-"-j $SYSCTL"}
+BUILD_CXX=0
+for lang in `echo $LANGUAGES | sed 's/,/ /g'`; do
+ if [ $lang = "c++" -o $lang = "obj-c++" ]; then
+ BUILD_CXX=1
+ break
+ fi
+done
+
+# Unset this, because GCC uses this variable in its makefiles
+unset LANGUAGES
+
# LLVM LOCAL begin
if [ "$ENABLE_LLVM" == true ]; then
# Build llvm-gcc in 'dylib mode'.
@@ -438,6 +453,7 @@
done
# APPLE LOCAL end native compiler support
+if [ $BUILD_CXX -eq 1 ]; then
for t in $TARGETS ; do
if [ "$t" == 'arm' ] ; then
cp -p $ARM_SYSROOT/usr/lib/libstdc++.6.dylib \
@@ -451,6 +467,7 @@
# LLVM LOCAL
# strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1
done
+fi
# include
HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS
@@ -478,18 +495,25 @@
# Add extra man page symlinks for 'c++' and for arch-specific names.
MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
-# LLVM LOCAL
-ln -f $MDIR/llvm-g++.1 $MDIR/llvm-c++.1 || exit 1
+if [ $BUILD_CXX -eq 1 ]; then
+ # LLVM LOCAL
+ ln -f $MDIR/llvm-g++.1 $MDIR/llvm-c++.1 || exit 1
+fi
for t in $TARGETS ; do
# LLVM LOCAL begin
ln -f $MDIR/llvm-gcc.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-gcc.1 \
|| exit 1
- ln -f $MDIR/llvm-g++.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++.1 \
- || exit 1
+ if [ $BUILD_CXX -eq 1 ]; then
+ ln -f $MDIR/llvm-g++.1 $MDIR/$t-apple-darwin$DARWIN_VERS-llvm-g++.1 \
+ || exit 1
+ fi
# LLVM LOCAL end
done
+
+# LLVM LOCAL begin
# Compress manpages
gzip -f $MDIR/*
+# LLVM LOCAL end
# Build driver-driver using fully-named drivers
for h in $HOSTS ; do
@@ -504,29 +528,31 @@
-L$DIR/obj-$h-$BUILD/libiberty/ \
-o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-gcc-$MAJ_VERS || exit 1
- $h-apple-darwin$DARWIN_VERS-gcc \
- $ORIG_SRC_DIR/driverdriver.c \
- -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS\"" \
- -DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
- -I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
- -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/ \
- -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/ \
- -L$DIR/obj-$h-$BUILD/libiberty/ \
- -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-g++-$MAJ_VERS || exit 1
+ if [ $BUILD_CXX -eq 1 ]; then
+ $h-apple-darwin$DARWIN_VERS-gcc \
+ $ORIG_SRC_DIR/driverdriver.c \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS\"" \
+ -DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
+ -I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
+ -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/ \
+ -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/ \
+ -L$DIR/obj-$h-$BUILD/libiberty/ \
+ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-llvm-g++-$MAJ_VERS || exit 1
+ fi
# LLVM LOCAL end
done
# LLVM LOCAL begin
lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-gcc-$MAJ_VERS -create \
$DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-gcc-$MAJ_VERS || exit 1
-
-lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-g++-$MAJ_VERS -create \
- $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
-
-ln -f $DEST_DIR/$DEST_ROOT/bin/llvm-g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/llvm-c++-$MAJ_VERS || exit 1
-
rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-gcc-$MAJ_VERS || exit 1
-rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
+
+if [ $BUILD_CXX -eq 1 ]; then
+ lipo -output $DEST_DIR/$DEST_ROOT/bin/llvm-g++-$MAJ_VERS -create \
+ $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
+ ln -f $DEST_DIR/$DEST_ROOT/bin/llvm-g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/llvm-c++-$MAJ_VERS || exit 1
+ rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-llvm-g++-$MAJ_VERS || exit 1
+fi
# LLVM LOCAL end
########################################
Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Thu Sep 18 19:07:05 2008
@@ -1,7 +1,95 @@
-2008-09-05 Josh Conner <jconner at apple.com>
- * llvm-convert.cpp (EmitBuiltinDwarfCFA): ARG_POINTER_CFA_OFFSET
- should take a function decl.
- * config/arm/arm.c: Remove unnecessary declaration of is_jump_table.
+2008-09-17 Josh Conner <jconner at apple.com>
+
+ Radar 6204451
+ * global.c (global_alloc): Remove code that ignores conflicts
+ on single-set tied pseudos.
+
+2008-09-16 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6214617
+ * c-common: New flag BLOCK_HAS_CXX_OBJ replaces BLOCK_NO_COPY.
+ (BlockImportsCxxObjects): New field replaces BlockHasByrefVar.
+ * c-parser.c (build_block_struct_type): Remove setting of
+ BLOCK_NO_COPY flag.
+
+2008-09-16 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6217257
+ * c-common.c (handle_blocks_attribute): Diagnose
+ vla __block declarations.
+
+2008-09-13 Josh Conner <jconner at apple.com>
+
+ Radar 6214296
+ * config/darwin.h (STARTFILE_SPEC): Don't add crt3.o to the link line
+ if -miphoneos-version-min was specified.
+
+2008-09-12 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6212507
+ * config/darwin-c.c (objc_check_format_cfstring): Check for
+ argument number value.
+
+2008-09-12 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6212722 (tweak)
+ * c-decl.c (build_block_ref_decl): Use array_to_pointer_conversion
+ and function_to_pointer_conversion.
+ * c-typeck.c (array_to_pointer_conversion, function_to_pointer_conversion):
+ Made them global.
+ * c-common.h (array_to_pointer_conversion, function_to_pointer_conversion):
+ Declare.
+
+2008-09-11 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6212722
+ * c-decl.c (build_block_ref_decl): Add support for array referenced
+ as copied in objects in blocks.
+
+2008-09-11 Caroline Tice <ctice at apple.com>
+
+ Radar 6066486
+ * dwarf2out.c (add_sibling_attribute): Move leaf-test return
+ statement to below the code that potentially removes the
+ DW_AT_MIPS_linkage_name attribute.
+
+2008-09-10 Caroline Tice <ctice at apple.com>
+
+ Radar 6193416
+ * dwarf2out.c (gen_subprogram_die): Force Blocks helper
+ functions to be children of the comp_unit die.
+
+2008-09-09 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6169580
+ * c-commmon.c (build_block_helper_name): Fix bug in
+ block helper function name mangling.
+
+2008-09-08 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6064186
+ * config/darwin.c (machopic_select_section): Message refs
+ symbol prefixes changed now. Accomodate it.
+ * config/darwin-sections.def: __objc_msgrefs is now typed
+ as "coalesced".
+
+2008-09-08 Stuart Hastings <stuart at apple.com>
+
+ Radar 6070085
+ * gcc/tree-ssa-alias.c (group_aliases): Continue merging alias
+ sets until the changes converge.
+
+2008-09-03 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6185344
+ * c-typeck.c (c_finish_return): Don't do block specific
+ stuff when block has a return type.
+ * c-common.h (block_sema_info): block_has_return_type is
+ a new field.
+ * c-parser.c (c_parser_direct_declarator): Terminate type
+ parsing for block return types.
+ (c_parser_block_literal_expr): Added support to parse and
+ handle explicit return type for blocks.
2008-08-28 Stuart Hastings <stuart at apple.com>
Modified: llvm-gcc-4.2/trunk/gcc/c-common.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.c Thu Sep 18 19:07:05 2008
@@ -6118,6 +6118,8 @@
int ARG_UNUSED (flags), bool *no_add_attrs)
{
tree arg_ident;
+ /* APPLE LOCAL radar 6217257 */
+ tree type;
*no_add_attrs = true;
if (!(*node) || TREE_CODE (*node) != VAR_DECL)
{
@@ -6134,7 +6136,19 @@
name);
return NULL_TREE;
}
-
+ /* APPLE LOCAL begin radar 6217257 */
+ type = TREE_TYPE (*node);
+ if (TREE_CODE (type) == ERROR_MARK)
+ return NULL_TREE;
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ {
+ if (!TYPE_SIZE (type) || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
+ {
+ error ("__block not allowed on a variable length array declaration");
+ return NULL_TREE;
+ }
+ }
+ /* APPLE LOCAL end radar 6217257 */
COPYABLE_BYREF_LOCAL_VAR (*node) = 1;
COPYABLE_BYREF_LOCAL_NONPOD (*node) = block_requires_copying (*node);
return NULL_TREE;
@@ -6288,7 +6302,10 @@
else
{
tree outer_decl = current_function_decl;
- while (outer_decl && DECL_CONTEXT (outer_decl))
+ /* APPLE LOCAL begin radar 6169580 */
+ while (outer_decl &&
+ DECL_CONTEXT (outer_decl) && TREE_CODE (DECL_CONTEXT (outer_decl)) == FUNCTION_DECL)
+ /* APPLE LOCAL end radar 6169580 */
outer_decl = DECL_CONTEXT (outer_decl);
buf = (char *)alloca (IDENTIFIER_LENGTH (DECL_NAME (outer_decl)) + 32);
sprintf (buf, "__%s_block_invoke_%d",
Modified: llvm-gcc-4.2/trunk/gcc/c-common.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-common.h (original)
+++ llvm-gcc-4.2/trunk/gcc/c-common.h Thu Sep 18 19:07:05 2008
@@ -1123,7 +1123,8 @@
enum {
BLOCK_NEEDS_FREE = (1 << 24),
BLOCK_HAS_COPY_DISPOSE = (1 << 25),
- BLOCK_NO_COPY = (1 << 26), /* interim byref: no copies allowed */
+ /* APPLE LOCAL radar 6214617 */
+ BLOCK_HAS_CXX_OBJ = (1 << 26),
BLOCK_IS_GC = (1 << 27),
/* APPLE LOCAL radar 5822844 */
BLOCK_IS_GLOBAL = (1 << 28)
@@ -1146,9 +1147,10 @@
bool hasPrototype;
bool isVariadic;
bool BlockHasCopyDispose;
- bool BlockHasByrefVar;
- /* APPLE LOCAL radar 5822844 */
- bool block_is_complete; /* When true, we are done analyzing block. */
+ /* APPLE LOCAL radar 6214617 */
+ bool BlockImportsCxxObjects;
+ /* APPLE LOCAL radar 6185344 */
+ bool block_has_return_type; /* When true, block has a declared return type. */
/* the_scope - This is the scope for the block itself, which
contains arguments etc. Use only for C. */
@@ -1180,7 +1182,7 @@
extern void build_block_internal_types (void);
extern void push_to_top_level (void);
extern void pop_from_top_level (void);
-extern void start_block_helper_function (tree func_decl, bool add_result_decl);
+extern void start_block_helper_function (tree func_decl);
extern void block_build_prologue (struct block_sema_info *block_impl);
extern tree c_finish_return (tree);
extern tree copy_in_object (tree);
@@ -1212,6 +1214,10 @@
/* APPLE LOCAL radar 6040305 - blocks */
extern tree build_indirect_object_id_exp (tree);
+/* APPLE LOCAL begin radar 6212722 */
+extern tree array_to_pointer_conversion (tree);
+extern tree function_to_pointer_conversion (tree);
+/* APPLE LOCAL end radar 6212722 */
/* APPLE LOCAL radar 6160536 */
extern tree build_block_helper_name (int);
Modified: llvm-gcc-4.2/trunk/gcc/c-decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-decl.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-decl.c Thu Sep 18 19:07:05 2008
@@ -3740,7 +3740,7 @@
NULL_TREE));
/* function header synthesis. */
push_function_context ();
- start_block_helper_function (block_byref_id_object_copy, true);
+ start_block_helper_function (block_byref_id_object_copy);
store_parm_decls_from (arg_info);
/* Body of the function. */
@@ -3805,7 +3805,7 @@
NULL_TREE);
/* function header synthesis. */
push_function_context ();
- start_block_helper_function (block_byref_id_object_dispose, true);
+ start_block_helper_function (block_byref_id_object_dispose);
store_parm_decls_from (arg_info);
/* Body of the function. */
@@ -8003,6 +8003,8 @@
{
struct c_scope *scope = current_scope;
tree ref_decl;
+ /* APPLE LOCAL radar 6212722 */
+ tree type, exp;
/* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */
/* 'decl' was previously declared as __byref. Simply, copy the value
embedded in the above variable. */
@@ -8049,10 +8051,20 @@
/* APPLE LOCAL end radar 5988451 (C++ ch) */
}
/* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ch) */
-
+ /* APPLE LOCAL begin radar 6212722 */
+ exp = decl;
+ type = TREE_TYPE (exp);
+ if (TREE_CODE (type) == ARRAY_TYPE) {
+ exp = array_to_pointer_conversion (decl);
+ type = TREE_TYPE (exp);
+ }
+ else if (TREE_CODE (type) == FUNCTION_TYPE) {
+ exp = function_to_pointer_conversion (exp);
+ type = TREE_TYPE (exp);
+ }
ref_decl = build_decl (VAR_DECL, name,
- build_qualified_type (TREE_TYPE (decl),
- TYPE_QUAL_CONST));
+ build_qualified_type (type, TYPE_QUAL_CONST));
+ /* APPLE LOCAL end radar 6212722 */
/* APPLE LOCAL begin radars 6144664 & 6145471 */
DECL_SOURCE_LOCATION (ref_decl) = DECL_SOURCE_LOCATION
(cur_block->helper_func_decl);
@@ -8075,7 +8087,8 @@
cur_block->block_ref_decl_list =
tree_cons (NULL_TREE, ref_decl, cur_block->block_ref_decl_list);
cur_block->block_original_ref_decl_list =
- tree_cons (NULL_TREE, decl, cur_block->block_original_ref_decl_list);
+ /* APPLE LOCAL radar 6212722 */
+ tree_cons (NULL_TREE, exp, cur_block->block_original_ref_decl_list);
return ref_decl;
}
@@ -8277,10 +8290,11 @@
It has removed all the fuss in the start_function().
*/
void
-start_block_helper_function (tree decl1, bool add_result_decl)
+start_block_helper_function (tree decl1)
{
struct c_label_context_se *nstack_se;
struct c_label_context_vm *nstack_vm;
+ tree restype, resdecl;
current_function_returns_value = 0; /* Assume, until we see it does. */
current_function_returns_null = 0;
@@ -8337,14 +8351,12 @@
push_scope ();
declare_parm_level ();
- if (add_result_decl)
- {
- tree restype = TREE_TYPE (TREE_TYPE (current_function_decl));
- tree resdecl = build_decl (RESULT_DECL, NULL_TREE, restype);
- DECL_ARTIFICIAL (resdecl) = 1;
- DECL_IGNORED_P (resdecl) = 1;
- DECL_RESULT (current_function_decl) = resdecl;
- }
+ restype = TREE_TYPE (TREE_TYPE (current_function_decl));
+ resdecl = build_decl (RESULT_DECL, NULL_TREE, restype);
+ DECL_ARTIFICIAL (resdecl) = 1;
+ DECL_IGNORED_P (resdecl) = 1;
+ DECL_RESULT (current_function_decl) = resdecl;
+
start_fname_decls ();
}
Modified: llvm-gcc-4.2/trunk/gcc/c-gimplify.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-gimplify.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-gimplify.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-gimplify.c Thu Sep 18 19:07:05 2008
@@ -204,15 +204,6 @@
switch (code)
{
- /* APPLE LOCAL begin radar 5732232 - blocks */
- case RETURN_EXPR:
- if (current_function_decl &&
- BLOCK_HELPER_FUNC (current_function_decl)) {
- tree ret_expr = TREE_OPERAND (*expr_p, 0);
- TREE_OPERAND (*expr_p, 0) = c_finish_return (ret_expr);
- }
- return GS_UNHANDLED;
- /* APPLE LOCAL end radar 5732232 - blocks */
case DECL_EXPR:
/* This is handled mostly by gimplify.c, but we have to deal with
not warning about int x = x; as it is a GCC extension to turn off
Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-parser.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-parser.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-parser.c Thu Sep 18 19:07:05 2008
@@ -95,6 +95,9 @@
#define IDENTIFIER 2
/* APPLE LOCAL end CW asm blocks (in 4.2 g) */
+/* APPLE LOCAL radar 6185344 */
+static int parsing_block_return_type;
+
/* The reserved keyword table. */
struct resword
{
@@ -2611,7 +2614,8 @@
/* Either we are at the end of an abstract declarator, or we have
parentheses. */
- if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
+ /* APPLE LOCAL radar 6185344 */
+ if (!parsing_block_return_type && c_parser_next_token_is (parser, CPP_OPEN_PAREN))
{
tree attrs;
struct c_declarator *inner;
@@ -9465,7 +9469,6 @@
if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain)))
{
block_impl->BlockHasCopyDispose = TRUE;
- block_impl->BlockHasByrefVar = TRUE;
break;
}
@@ -9521,7 +9524,7 @@
/**
build_block_struct_initlist - builds the initializer list:
{ &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa,
- BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
+ BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
sizeof(struct block_1),
helper_1 },
copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE
@@ -9546,10 +9549,6 @@
we have destroy_helper_block/copy_helper_block helper
routines. */
flags |= BLOCK_HAS_COPY_DISPOSE;
- /* Set BLOCK_NO_COPY flag only if we are using the old byref,
- indirect reference byref variables. */
- if (block_impl->block_byref_decl_list && !block_impl->BlockHasByrefVar)
- flags |= BLOCK_NO_COPY;
fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type));
@@ -9663,7 +9662,7 @@
3) build the temporary initialization:
struct block_1 I = {
{ &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa,
- BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
+ BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
sizeof(struct block_1),
helper_1 },
copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE
@@ -9752,7 +9751,7 @@
NULL_TREE));
/* function header synthesis. */
push_function_context ();
- start_block_helper_function (cur_block->copy_helper_func_decl, true);
+ start_block_helper_function (cur_block->copy_helper_func_decl);
store_parm_decls_from (arg_info);
/* Body of the function. */
@@ -9852,7 +9851,7 @@
/* function header synthesis. */
push_function_context ();
- start_block_helper_function (cur_block->destroy_helper_func_decl, true);
+ start_block_helper_function (cur_block->destroy_helper_func_decl);
store_parm_decls_from (arg_info);
/* Body of the function. */
@@ -9943,13 +9942,30 @@
struct block_sema_info *block_impl;
tree tmp;
bool open_paren_seen = false;
- tree restype, resdecl;
+ tree restype;
tree fnbody, typelist;
tree helper_function_type;
tree block;
+ /* APPLE LOCAL radar 6185344 */
+ tree declared_block_return_type = NULL_TREE;
c_parser_consume_token (parser); /* eat '^' */
+ /* APPLE LOCAL begin radar 6185344 */
+ /* Parse user declared return type. */
+ if (!c_parser_next_token_is (parser, CPP_OPEN_PAREN) &&
+ !c_parser_next_token_is (parser, CPP_OPEN_BRACE))
+ {
+ struct c_type_name *type;
+ parsing_block_return_type = 1;
+ type = c_parser_type_name (parser);
+ parsing_block_return_type = 0;
+ if (type) {
+ declared_block_return_type = groktypename (type);
+ }
+ }
+ /* APPLE LOCAL end radar 6185344 */
+
/* Parse the optional argument list */
if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
{
@@ -9976,7 +9992,13 @@
block = begin_block ();
cur_block->arg_info = NULL;
- cur_block->return_type = NULL_TREE;
+ if (declared_block_return_type)
+ {
+ cur_block->return_type = TYPE_MAIN_VARIANT (declared_block_return_type);
+ cur_block->block_has_return_type = true;
+ }
+ else
+ cur_block->return_type = NULL_TREE;
if (args)
{
@@ -10013,20 +10035,24 @@
cur_block->arg_info->types = tree_cons (NULL_TREE, ptr_type_node, arg_type);
cur_block->arg_info->parms = self_arg;
- /* Build the declaration of the helper function (we do not know its result
- type yet, so assume it is 'void'). Treat this as a nested function and use
- nested function infrastructure for its generation. */
-
- ftype = build_function_type (void_type_node, cur_block->arg_info->types);
+ /* APPLE LOCAL begin radar 6185344 */
+ /* Build the declaration of the helper function (if we do not know its result
+ type yet, assume it is 'void'. If user provided it, use it).
+ Treat this as a nested function and use nested function infrastructure for
+ its generation. */
+
+ ftype = build_function_type ((!cur_block->block_has_return_type
+ ? void_type_node : cur_block->return_type),
+ cur_block->arg_info->types);
+ /* APPLE LOCAL end radar 6185344 */
/* APPLE LOCAL radar 6160536 */
block_helper_function_decl = build_helper_func_decl (build_block_helper_name (unique_count),
ftype);
DECL_CONTEXT (block_helper_function_decl) = current_function_decl;
- BLOCK_HELPER_FUNC (block_helper_function_decl) = 1;
cur_block->helper_func_decl = block_helper_function_decl;
push_function_context ();
- start_block_helper_function (cur_block->helper_func_decl, false);
+ start_block_helper_function (cur_block->helper_func_decl);
/* Set block's scope to the scope of the helper function's main body.
This is primarily used when nested blocks are declared. */
/* FIXME: Name of objc_get_current_scope needs to get changed. */
@@ -10049,34 +10075,45 @@
c_cont_label = save_c_cont_label;
c_break_label = save_c_break_label;
}
- else {
- struct c_expr expr;
- stmt = c_begin_compound_stmt (true);
- error ("blocks require { }");
- expr = c_parser_cast_expression (parser, NULL);
- body = expr.value;
- if (body == error_mark_node)
- return clean_and_exit (block);
-
- if (cur_block->return_type) {
- error ("return not allowed in block expression literal");
- return clean_and_exit (block);
- }
- else if (!open_paren_seen) {
- error ("argument list is required for block expression literals");
- return clean_and_exit (block);
- }
- else {
- add_stmt (body);
- cur_block->return_type = TREE_TYPE (body);
+ else
+ {
+ struct c_expr expr;
+ stmt = c_begin_compound_stmt (true);
+ error ("blocks require { }");
+ expr = c_parser_cast_expression (parser, NULL);
+ body = expr.value;
+ if (body == error_mark_node)
+ return clean_and_exit (block);
+
+ if (cur_block->return_type)
+ {
+ error ("return not allowed in block expression literal");
+ return clean_and_exit (block);
+ }
+ else if (!open_paren_seen)
+ {
+ error ("argument list is required for block expression literals");
+ return clean_and_exit (block);
+ }
+ else
+ {
+ tree restype = TYPE_MAIN_VARIANT (TREE_TYPE (body));
+
+ add_stmt (body);
+ TREE_TYPE (current_function_decl)
+ = build_function_type (restype,
+ TYPE_ARG_TYPES (TREE_TYPE (current_function_decl)));
+ TREE_TYPE (DECL_RESULT (current_function_decl)) = restype;
+ relayout_decl (DECL_RESULT (current_function_decl));
+ cur_block->return_type = restype;
+ }
}
- }
cur_block->block_arg_ptr_type =
build_pointer_type (build_block_struct_type (cur_block));
restype = !cur_block->return_type ? void_type_node
- : cur_block->return_type;
+ : cur_block->return_type;
if (restype == error_mark_node)
return clean_and_exit (block);
@@ -10084,11 +10121,9 @@
TREE_TYPE (self_arg) = cur_block->block_arg_ptr_type;
DECL_ARG_TYPE (self_arg) = cur_block->block_arg_ptr_type;
- /* Now that we know helper's result type, fix its result variable decl. */
- resdecl = build_decl (RESULT_DECL, NULL_TREE, restype);
- DECL_ARTIFICIAL (resdecl) = 1;
- DECL_IGNORED_P (resdecl) = 1;
- DECL_RESULT (current_function_decl) = resdecl;
+ /* The DECL_RESULT should already have the correct type by now. */
+ gcc_assert (TREE_TYPE (DECL_RESULT (current_function_decl))
+ == restype);
cur_block->block_body = stmt;
block_build_prologue (cur_block);
@@ -10111,11 +10146,6 @@
typelist);
helper_function_type = build_function_type (TREE_TYPE (ftype), typelist);
TREE_TYPE (cur_block->helper_func_decl) = helper_function_type;
- /* Let tree builder know that we are done analyzing block's return type so it
- does not do it twice (and produce bad return expression tree). This case is
- for global blocks as finish_function () for them builds AST for the entire
- body of the function. */
- cur_block->block_is_complete = true;
finish_function ();
pop_function_context ();
Modified: llvm-gcc-4.2/trunk/gcc/c-pragma.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-pragma.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-pragma.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-pragma.c Thu Sep 18 19:07:05 2008
@@ -249,7 +249,6 @@
}
}
#endif /* HANDLE_PRAGMA_PACK */
-
/* LLVM LOCAL begin */
#endif /* ENABLE_LLVM && !TARGET_OVERRIDE_PRAGMA_PACK_HANDLER */
/* LLVM LOCAL end */
Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Thu Sep 18 19:07:05 2008
@@ -1518,7 +1518,8 @@
}
/* Convert the array expression EXP to a pointer. */
-static tree
+/* APPLE LOCAL radar 6212722 */
+tree
array_to_pointer_conversion (tree exp)
{
tree orig_exp = exp;
@@ -1559,7 +1560,8 @@
}
/* Convert the function expression EXP to a pointer. */
-static tree
+/* APPLE LOCAL radar 6212722 */
+tree
function_to_pointer_conversion (tree exp)
{
tree orig_exp = exp;
@@ -7715,16 +7717,25 @@
the block from it. */
if (cur_block->return_type == NULL_TREE)
{
+ tree restype;
if (retval)
- cur_block->return_type = TYPE_MAIN_VARIANT (TREE_TYPE (retval));
+ {
+ restype = TYPE_MAIN_VARIANT (TREE_TYPE (retval));
+ TREE_TYPE (current_function_decl)
+ = build_function_type (restype,
+ TYPE_ARG_TYPES (TREE_TYPE (current_function_decl)));
+ TREE_TYPE (DECL_RESULT (current_function_decl)) = restype;
+ relayout_decl (DECL_RESULT (current_function_decl));
+ }
else
- cur_block->return_type = void_type_node;
- return retval;
+ restype = void_type_node;
+
+ cur_block->return_type = restype;
}
- /* Otherwise, verify that this result type matches the previous one. We are
- pickier with blocks than for normal functions because this is a new
- feature and we set the rules. */
+ /* Verify that this result type matches the previous one. We are
+ pickier with blocks than for normal functions because this is a
+ new feature and we set the rules. */
if (TREE_CODE (cur_block->return_type) == VOID_TYPE)
{
if (retval)
@@ -7738,7 +7749,7 @@
if (!retval)
{
error ("non-void block should return a value");
- return retval;
+ return error_mark_node;
}
/* We have a non-void block with an expression, continue checking. */
@@ -7763,14 +7774,13 @@
tree valtype, ret_stmt;
bool no_warning = false;
- /* APPLE LOCAL radar 5822844 */
- if (cur_block && !cur_block->block_is_complete) {
- /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */
- release_all_local_byrefs_at_return ();
- retval = c_finish_block_return_stmt (retval);
- ret_stmt = build_stmt (RETURN_EXPR, retval);
- return add_stmt (ret_stmt);
- }
+ /* APPLE LOCAL radar 5822844 - radar 6185344 */
+ if (cur_block && !cur_block->block_has_return_type)
+ {
+ retval = c_finish_block_return_stmt (retval);
+ if (retval == error_mark_node)
+ return NULL_TREE;
+ }
valtype = TREE_TYPE (TREE_TYPE (current_function_decl));
/* APPLE LOCAL end radar 5732232 - blocks */
@@ -7842,17 +7852,18 @@
case ADDR_EXPR:
inner = TREE_OPERAND (inner, 0);
- /* LLVM LOCAL begin */
+ /* LLVM LOCAL begin */
while (REFERENCE_CLASS_P (inner)
- && TREE_CODE (inner) != INDIRECT_REF) {
+ && TREE_CODE (inner) != INDIRECT_REF)
+ {
#ifdef ENABLE_LLVM
- if (TREE_CODE (inner) == ARRAY_REF
- && (TREE_CODE (TREE_TYPE (TREE_OPERAND (inner, 0)))
- != ARRAY_TYPE))
- break; /* Ignore pointer base of array ref extension. */
+ if (TREE_CODE (inner) == ARRAY_REF
+ && (TREE_CODE (TREE_TYPE (TREE_OPERAND (inner, 0)))
+ != ARRAY_TYPE))
+ break; /* Ignore pointer base of array ref extension. */
#endif
- inner = TREE_OPERAND (inner, 0);
- }
+ inner = TREE_OPERAND (inner, 0);
+ }
/* LLVM LOCAL end */
if (DECL_P (inner)
@@ -7879,12 +7890,6 @@
retval = build2 (MODIFY_EXPR, TREE_TYPE (res), res, t);
}
- /* APPLE LOCAL begin radar 5732232 - blocks */
- /* When this routine is called for the helper function, during gimplification,
- we are only interested in the actual return expression. */
- if (current_function_decl && BLOCK_HELPER_FUNC (current_function_decl))
- return retval;
- /* APPLE LOCAL end radar 5732232 - blocks */
/* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */
release_all_local_byrefs_at_return ();
ret_stmt = build_stmt (RETURN_EXPR, retval);
Modified: llvm-gcc-4.2/trunk/gcc/calls.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/calls.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/calls.c (original)
+++ llvm-gcc-4.2/trunk/gcc/calls.c Thu Sep 18 19:07:05 2008
@@ -249,6 +249,8 @@
rtx rounded_stack_size_rtx = GEN_INT (rounded_stack_size);
rtx call_insn;
int already_popped = 0;
+ /* APPLE LOCAL async unwind info 5976588 */
+ rtx dwarf = NULL_RTX;
HOST_WIDE_INT n_popped = RETURN_POPS_ARGS (fndecl, funtype, stack_size);
#if defined (HAVE_call) && defined (HAVE_call_value)
rtx struct_value_size_rtx;
@@ -368,6 +370,18 @@
/* Find the call we just emitted. */
call_insn = last_call_insn ();
+ /* APPLE LOCAL begin async unwind info 5976588 */
+ if (already_popped && n_popped
+ && flag_asynchronous_unwind_tables && ACCUMULATE_OUTGOING_ARGS)
+ {
+ dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx, n_popped));
+ REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
+ REG_NOTES (call_insn));
+ RTX_FRAME_RELATED_P (call_insn) = 1;
+ }
+ /* APPLE LOCAL end async unwind info 5976588 */
+
/* Mark memory as used for "pure" function call. */
if (ecf_flags & ECF_PURE)
call_fusage
@@ -480,7 +494,20 @@
??? It will be worthwhile to enable combine_stack_adjustments even for
such machines. */
else if (n_popped)
- anti_adjust_stack (GEN_INT (n_popped));
+ /* APPLE LOCAL begin async unwind info 5976588 */
+ {
+ anti_adjust_stack (GEN_INT (n_popped));
+ if (dwarf)
+ {
+ rtx last_insn = get_last_nonnote_insn ();
+ dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx, -n_popped));
+ REG_NOTES (last_insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
+ REG_NOTES (last_insn));
+ RTX_FRAME_RELATED_P (last_insn) = 1;
+ }
+ }
+ /* APPLE LOCAL end async unwind info 5976588 */
}
/* Determine if the function identified by NAME and FNDECL is one with
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Thu Sep 18 19:07:05 2008
@@ -84,6 +84,7 @@
static const char *fp_const_from_val (REAL_VALUE_TYPE *);
static arm_cc get_arm_condition_code (rtx);
static HOST_WIDE_INT int_log2 (HOST_WIDE_INT);
+static rtx is_jump_table (rtx);
static const char *output_multi_immediate (rtx *, const char *, const char *,
int, HOST_WIDE_INT);
static const char *shift_op (rtx, HOST_WIDE_INT *);
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-c.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin-c.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Thu Sep 18 19:07:05 2008
@@ -1150,6 +1150,13 @@
bool *no_add_attrs)
{
unsigned HOST_WIDE_INT i;
+ /* APPLE LOCAL begin 6212507 */
+ if (format_num < 1)
+ {
+ error ("argument number of CFString format cannot be less than one");
+ return false;
+ }
+ /* APPLE LOCAL end 6212507 */
for (i = 1; i != format_num; i++)
{
if (argument == 0)
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def Thu Sep 18 19:07:05 2008
@@ -94,8 +94,10 @@
".section " EH_FRAME_SECTION_NAME ",__eh_frame"
EH_FRAME_SECTION_ATTR, 0)
/* APPLE LOCAL begin ObjC new abi - radar 4792158 */
+/* APPLE LOCAL begin radar 5575115 */
DEF_SECTION (objc_v2_message_refs_section, 0,
- ".section __DATA, __objc_msgrefs, regular, no_dead_strip", 1)
+ ".section __DATA, __objc_msgrefs, coalesced", 0)
+/* APPLE LOCAL end radar 5575115 */
DEF_SECTION (objc_v2_classrefs_section, 0,
".section __DATA, __objc_classrefs, regular, no_dead_strip", 1)
DEF_SECTION (objc_v2_classlist_section, 0,
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Thu Sep 18 19:07:05 2008
@@ -1427,7 +1427,10 @@
DECL_NAME (exp) &&
TREE_CODE (DECL_NAME (exp)) == IDENTIFIER_NODE &&
IDENTIFIER_POINTER (DECL_NAME (exp)) &&
- !strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "_OBJC_", 6))
+ /* APPLE LOCAL begin radar 5575115 */
+ (!strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "_OBJC_", 6)
+ || !strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "l_objc_", 7)))
+ /* APPLE LOCAL end radar 5575115 */
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (exp));
/* APPLE LOCAL begin radar 4792158 */
@@ -1502,7 +1505,8 @@
return darwin_sections[objc_v2_classrefs_section];
else if (!strncmp (name, "_OBJC_CLASSLIST_SUP_REFS_", 25))
return darwin_sections[objc_v2_super_classrefs_section];
- else if (!strncmp (name, "_OBJC_MESSAGE_REF", 17))
+ /* APPLE LOCAL radar 5575115 */
+ else if (!strncmp (name, "l_objc_msgSend_", 15))
return darwin_sections[objc_v2_message_refs_section];
else if (!strncmp (name, "_OBJC_LABEL_CLASS_", 18))
return darwin_sections[objc_v2_classlist_section];
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Thu Sep 18 19:07:05 2008
@@ -310,6 +310,8 @@
if (flag_mkernel) \
flag_no_builtin = 1; \
/* APPLE LOCAL end 5731065 */ \
+ /* APPLE LOCAL xmmintrin.h for kernel 4123064 */ \
+ flag_hosted = 0; \
} \
} while (0)
@@ -535,7 +537,9 @@
%{!object:%{preload:-lcrt0.o} \
%{!preload: %(darwin_crt1) \
%(darwin_crt2)}}}}}} \
- %{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}"
+ %{shared-libgcc: \
+ %{!miphoneos-version-min=*: \
+ %:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}}"
/* APPLE LOCAL end mainline */
/* The native Darwin linker doesn't necessarily place files in the order
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=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Thu Sep 18 19:07:05 2008
@@ -6285,13 +6285,7 @@
/* If not an i386, mov & pop is faster than "leave". */
else if (TARGET_USE_LEAVE || optimize_size
|| !cfun->machine->use_fast_prologue_epilogue)
- /* APPLE LOCAL begin async unwind info 5949350 */
- {
- rtx insn = emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ());
- if (flag_asynchronous_unwind_tables)
- RTX_FRAME_RELATED_P (insn) = 1;
- }
- /* APPLE LOCAL end async unwind info 5949350 */
+ emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ());
else
{
pro_epilogue_adjust_stack (stack_pointer_rtx,
@@ -6331,13 +6325,7 @@
/* Leave results in shorter dependency chains on CPUs that are
able to grok it fast. */
if (TARGET_USE_LEAVE)
- /* APPLE LOCAL begin async unwind info 5949350 */
- {
- rtx insn = emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ());
- if (flag_asynchronous_unwind_tables)
- RTX_FRAME_RELATED_P (insn) = 1;
- }
- /* APPLE LOCAL end async unwind info 5949350 */
+ emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ());
else if (TARGET_64BIT)
emit_insn (gen_popdi1 (hard_frame_pointer_rtx));
else
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/xmmintrin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/xmmintrin.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/xmmintrin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/xmmintrin.h Thu Sep 18 19:07:05 2008
@@ -40,7 +40,11 @@
#include <mmintrin.h>
/* Get _mm_malloc () and _mm_free (). */
+/* APPLE LOCAL begin xmmintrin.h for kernel 4123064 */
+#if __STDC_HOSTED__
#include <mm_malloc.h>
+#endif
+/* APPLE LOCAL end xmmintrin.h for kernel 4123064 */
/* The Intel API is flexible enough that we must allow aliasing with other
vector types, and their scalar components. */
Modified: llvm-gcc-4.2/trunk/gcc/cp/ChangeLog
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/ChangeLog?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/ChangeLog (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/ChangeLog Thu Sep 18 19:07:05 2008
@@ -1,3 +1,14 @@
+ # APPLE LOCAL begin mainline radar 6194879
+2007-08-22 Jason Merrill <jason at redhat.com>
+
+ PR c++/29365
+ * pt.c (outermost_tinst_level): New function.
+ * lex.c (in_main_input_context): New function.
+ * cp-tree.h: Declare it.
+ * decl2.c (constrain_class_visibility): Use it to avoid warning
+ about uses of the anonymous namespace in the main input file.
+
+ # APPLE LOCAL end mainline radar 6194879
# APPLE LOCAL begin for-fsf-4_4 3274130 5295549
2007-08-03 Geoffrey Keating <geoffk at apple.com>
Modified: llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple Thu Sep 18 19:07:05 2008
@@ -1,3 +1,63 @@
+2008-09-16 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6214617
+ * parser.c (cp_block_requires_copying): New
+ (build_block_struct_type): Set BlockImportsCxxObjects flag.
+ (build_block_struct_initlist): Set BLOCK_HAS_CXX_OBJ if need be.
+ (synth_copy_helper_block_func): Call copy ctor if copied in object has one.
+ (synth_destroy_helper_block_func): Call dtor on cxx object.
+
+2008-09-12 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6212722 (tweak)
+ * parser.c (build_block_ref_decl): Use decay_conversion.
+
+2008-09-11 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6212722
+ * parser.c (build_block_ref_decl): Add support for arrays referenced
+ as copied in objects in blocks.
+
+2008-09-09 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6169580
+ * decl.c (synth_block_byref_id_object_copy_func): Pass new flag
+ to finish_function.
+ (synth_block_byref_id_object_): Ditto.
+ (finish_function): Don't pop the nested class when synthesizing
+ block helpers.
+ * semantics.c (finish_id_expression): Added logic to attach
+ copied-in "this" to stand-alone field reference in a block.
+ * parser.c (synth_copy_helper_block_func, synth_destroy_helper_block_func):
+ Pass new flag to finish_function.
+ (cp_parser_block_literal_expr): When block is in non-static member
+ function, need to import "this" as a read-only copied in variable.
+
+
+2008-09-05 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6169527
+ * parser.c (build_block_struct_type): Set CLASSTYPE_AS_BASE.
+ (build_block_internal_types): Ditto.
+ (build_block_struct_initlist): Rewritten.
+ (build_block_literal_tmp): Rewritten.
+ (build_block_ref_decl): Just add copied-in variable to
+ the scope.
+ (declare_block_prologue_local_vars): Rewritten.
+ (declare_block_prologue_local_byref_vars): New
+ (block_build_prologue): Call declare_block_prologue_local_byref_vars
+ for byref variables.
+
+2008-09-03 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6185344
+ * typeck.c (check_return_expr): Added extra check
+ for return type checking.
+ * parser.c (cp_parser_direct_declarator): Added
+ extra check for type used as block return type.
+ (cp_parser_block_literal_expr): Parse and handle
+ user provided block return type syntax.
+
2008-08-28 Fariborz Jahanian <fjahanian at apple.com>
Radar 6160536
Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h Thu Sep 18 19:07:05 2008
@@ -4155,9 +4155,8 @@
extern void yyhook (int);
extern bool cxx_init (void);
extern void cxx_finish (void);
-/* LLVM LOCAL begin - Fix for GCC PR c++/29365 */
+/* APPLE LOCAL mainline radar 6194879 */
extern bool in_main_input_context (void);
-/* LLVM LOCAL end */
/* in method.c */
extern void init_method (void);
@@ -4240,9 +4239,8 @@
extern bool reregister_specialization (tree, tree, tree);
extern tree fold_non_dependent_expr (tree);
extern bool explicit_class_specialization_p (tree);
-/* LLVM LOCAL begin - Fix for GCC PR c++/29365 */
+/* APPLE LOCAL mainline radar 6194879 */
extern tree outermost_tinst_level (void);
-/* LLVM LOCAL end */
/* in repo.c */
extern void init_repo (void);
@@ -4689,9 +4687,9 @@
/* APPLE LOCAL radar 5741070 */
extern tree c_return_interface_record_type (tree);
-/* APPLE LOCAL begin block 6040305 (cg) */
+/* APPLE LOCAL begin blocks 6040305 (cg) */
extern cp_declarator* make_block_pointer_declarator (tree, cp_cv_quals,
cp_declarator *);
-/* APPLE LOCAL end block 6040305 (cg) */
+/* APPLE LOCAL end blocks 6040305 (cg) */
#endif /* ! GCC_CP_TREE_H */
Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Thu Sep 18 19:07:05 2008
@@ -5394,7 +5394,8 @@
/* APPLE LOCAL end radar 6180456 */
finish_compound_stmt (stmt);
- finish_function (0);
+ /* APPLE LOCAL radar 6169580 */
+ finish_function (4);
pop_function_context ();
}
@@ -5447,7 +5448,8 @@
add_stmt (rel_exp);
finish_compound_stmt (stmt);
- finish_function (0);
+ /* APPLE LOCAL radar 6169580 */
+ finish_function (4);
pop_function_context ();
}
@@ -11881,6 +11883,8 @@
tree fndecl = current_function_decl;
tree fntype, ctype = NULL_TREE;
int inclass_inline = (flags & 2) != 0;
+ /* APPLE LOCAL radar 6169580 */
+ int in_blocks_helper_function = (flags & 4) != 0;
int nested;
/* When we get some parse errors, we can end up without a
@@ -12076,7 +12080,8 @@
maybe_end_member_template_processing ();
/* Leave the scope of the class. */
- if (ctype)
+ /* APPLE LOCAL radar 6169580 */
+ if (ctype && !in_blocks_helper_function)
pop_nested_class ();
--function_depth;
Modified: llvm-gcc-4.2/trunk/gcc/cp/decl2.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl2.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/decl2.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/decl2.c Thu Sep 18 19:07:05 2008
@@ -1893,16 +1893,14 @@
int subvis = type_visibility (ftype);
if (subvis == VISIBILITY_ANON)
- /* LLVM LOCAL begin - Fix for GCC PR c++/29365 */
+ /* APPLE LOCAL begin mainline radar 6194879 */
{
-#ifdef ENABLE_LLVM
if (!in_main_input_context ())
-#endif
warning (0, "\
%qT has a field %qD whose type uses the anonymous namespace",
type, t);
}
- /* LLVM LOCAL end */
+ /* APPLE LOCAL end mainline radar 6194879 */
else if (IS_AGGR_TYPE (ftype)
&& vis < VISIBILITY_HIDDEN
&& subvis >= VISIBILITY_HIDDEN)
@@ -1917,16 +1915,14 @@
int subvis = type_visibility (TREE_TYPE (t));
if (subvis == VISIBILITY_ANON)
- /* LLVM LOCAL begin - Fix for GCC PR c++/29365 */
+ /* APPLE LOCAL begin mainline radar 6194879 */
{
-#ifdef ENABLE_LLVM
if (!in_main_input_context())
-#endif
warning (0, "\
%qT has a base %qT whose type uses the anonymous namespace",
type, TREE_TYPE (t));
}
- /* LLVM LOCAL end */
+ /* APPLE LOCAL end mainline radar 6194879 */
else if (vis < VISIBILITY_HIDDEN
&& subvis >= VISIBILITY_HIDDEN)
warning (OPT_Wattributes, "\
Modified: llvm-gcc-4.2/trunk/gcc/cp/lex.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/lex.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/lex.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/lex.c Thu Sep 18 19:07:05 2008
@@ -877,8 +877,8 @@
return t;
}
+/* APPLE LOCAL begin mainline radar 6194879 */
-/* LLVM LOCAL begin - Fix for GCC PR c++/29365 */
/* Returns true if we are currently in the main source file, or in a
template instantiation started from the main source file. */
@@ -893,4 +893,4 @@
else
return strcmp (main_input_filename, input_filename) == 0;
}
-/* LLVM LOCAL end */
+/* APPLE LOCAL end mainline radar 6194879 */
Modified: llvm-gcc-4.2/trunk/gcc/cp/parser.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/parser.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/parser.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/parser.c Thu Sep 18 19:07:05 2008
@@ -12530,6 +12530,10 @@
return declarator;
}
+/* APPLE LOCAL begin blocks 6185344 */
+static int parsing_block_return_type;
+/* APPLE LOCAL end blocks 6185344 */
+
/* Parse a direct-declarator or direct-abstract-declarator.
direct-declarator:
@@ -12575,7 +12579,8 @@
{
/* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer);
- if (token->type == CPP_OPEN_PAREN)
+ /* APPLE LOCAL radar 6185344 */
+ if (!parsing_block_return_type && token->type == CPP_OPEN_PAREN)
{
/* This is either a parameter-declaration-clause, or a
parenthesized declarator. When we know we are parsing a
@@ -20498,10 +20503,22 @@
{
if (!DECL_P (member))
member = lookup_member (TREE_TYPE (e), member, 0, 0);
+ if (processing_template_decl)
+ return build3 (COMPONENT_REF, TREE_TYPE (member), e, DECL_NAME (member), NULL_TREE);
return build_class_member_access_expr (e, member,
NULL_TREE, false);
}
+/* APPLE LOCAL begin radar 6214617 */
+static bool
+cp_block_requires_copying (tree exp)
+{
+ return (block_requires_copying (exp)
+ || TYPE_HAS_CONSTRUCTOR (TREE_TYPE (exp))
+ || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (exp)));
+}
+/* APPLE LOCAL end radar 6214617 */
+
static tree block_copy_assign_decl;
static tree block_destroy_decl;
@@ -20529,10 +20546,17 @@
helper function. If yes, set BlockHasCopyDispose to TRUE. */
for (chain = block_impl->block_ref_decl_list; chain;
chain = TREE_CHAIN (chain))
- if (block_requires_copying (TREE_VALUE (chain)))
+ /* APPLE LOCAL begin radar 6214617 */
+ if (cp_block_requires_copying (TREE_VALUE (chain)))
{
+ tree type = TREE_TYPE (TREE_VALUE (chain));
block_impl->BlockHasCopyDispose = TRUE;
- break;
+ if (TYPE_HAS_CONSTRUCTOR (type) || TYPE_NEEDS_CONSTRUCTING (type))
+ {
+ block_impl->BlockImportsCxxObjects = TRUE;
+ break;
+ }
+ /* APPLE LOCAL end radar 6214617 */
}
/* Further check to see that we have __byref variables which require
@@ -20542,7 +20566,6 @@
if (COPYABLE_BYREF_LOCAL_VAR (TREE_VALUE (chain)))
{
block_impl->BlockHasCopyDispose = TRUE;
- block_impl->BlockHasByrefVar = TRUE;
break;
}
@@ -20603,7 +20626,11 @@
/* finish_struct (block_struct_type, field_decl_chain, NULL_TREE); */
finish_builtin_struct (block_struct_type, buffer,
fields, NULL_TREE);
-
+ /* APPLE LOCAL begin radar 6169527 */
+ /* This type is now a full-blown c++ struct and as such, this field must
+ be set. */
+ CLASSTYPE_AS_BASE (block_struct_type) = block_struct_type;
+ /* APPLE LOCAL end radar 6169527 */
/* Zap out the name so that the back-end will give us the debugging
information for this anonymous RECORD_TYPE. */
TYPE_NAME (block_struct_type) = NULL_TREE;
@@ -20614,37 +20641,42 @@
/**
build_block_struct_initlist - builds the initializer list:
{ &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa,
- BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
- sizeof(struct block_1),
- helper_1 },
+ BLOCK_HAS_CXX_OBJ | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
+ sizeof(struct block_1),
+ helper_1
+ },
copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE
destroy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE
x,
&y
}
*/
-static tree
+/* APPLE LOCAL begin radar 6169527 */
+/* This routine is entirely rewritten as we now have to deal with full-blown
+ c++ classes with fields which may require construction. */
+static VEC(constructor_elt,gc) *
build_block_struct_initlist (tree block_struct_type,
struct block_sema_info *block_impl)
{
- tree initlist;
int size;
- tree helper_addr, chain, fields;
+ tree helper_addr, chain;
unsigned flags = 0;
static tree NSConcreteStackBlock_decl = NULL_TREE;
static tree NSConcreteGlobalBlock_decl = NULL_TREE;
+ tree impl_constructor;
+ VEC(constructor_elt,gc) *impl_v = NULL;
+ VEC(constructor_elt,gc) *v = NULL;
if (block_impl->BlockHasCopyDispose)
/* Note! setting of this flag merely indicates to the runtime that
we have destroy_helper_block/copy_helper_block helper
routines. */
flags |= BLOCK_HAS_COPY_DISPOSE;
- /* Set BLOCK_NO_COPY flag only if we are using the old byref,
- indirect reference byref variables. */
- if (block_impl->block_byref_decl_list && !block_impl->BlockHasByrefVar)
- flags |= BLOCK_NO_COPY;
-
- fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type));
+ /* APPLE LOCAL begin radar 6214617 */
+ /* Set BLOCK_HAS_CXX_OBJ if block is importing a cxx object. */
+ if (block_impl->BlockImportsCxxObjects)
+ flags |= BLOCK_HAS_CXX_OBJ;
+ /* APPLE LOCAL end radar 6214617 */
if (!current_function_decl)
{
@@ -20664,8 +20696,7 @@
rest_of_decl_compilation (NSConcreteGlobalBlock_decl, 0, 0);
}
}
- initlist = build_tree_list (fields,
- build_fold_addr_expr (NSConcreteGlobalBlock_decl));
+ CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_fold_addr_expr (NSConcreteGlobalBlock_decl));
flags |= BLOCK_IS_GLOBAL;
}
else
@@ -20685,60 +20716,50 @@
rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0);
}
}
- initlist = build_tree_list (fields,
- build_fold_addr_expr (NSConcreteStackBlock_decl));
+ CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_fold_addr_expr (NSConcreteStackBlock_decl));
}
- fields = TREE_CHAIN (fields);
- initlist = tree_cons (fields,
- build_int_cst (unsigned_type_node, flags),
- initlist);
- fields = TREE_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (unsigned_type_node, flags));
+
size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_struct_type));
- initlist = tree_cons (fields,
- build_int_cst (unsigned_type_node, size),
- initlist);
- fields = TREE_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, build_int_cst (unsigned_type_node, size));
+
helper_addr = build_fold_addr_expr (block_impl->helper_func_decl);
/* mark_used (block_impl->helper_func_decl); */
helper_addr = convert (ptr_type_node, helper_addr);
- initlist = tree_cons (fields, helper_addr, initlist);
- gcc_assert (invoke_impl_ptr_type);
- initlist = build_constructor_from_list (TREE_TYPE (invoke_impl_ptr_type),
- nreverse (initlist));
- fields = TYPE_FIELDS (block_struct_type);
- initlist = build_tree_list (fields, initlist);
+ CONSTRUCTOR_APPEND_ELT(impl_v, NULL_TREE, helper_addr);
+ impl_constructor = make_node (CONSTRUCTOR);
+ CONSTRUCTOR_ELTS (impl_constructor) = impl_v;
+ CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, impl_constructor);
+
if (block_impl->BlockHasCopyDispose)
{
- fields = TREE_CHAIN (fields);
helper_addr = build_fold_addr_expr (block_impl->copy_helper_func_decl);
helper_addr = convert (ptr_type_node, helper_addr);
- initlist = tree_cons (fields, helper_addr, initlist);
- fields = TREE_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, helper_addr);
helper_addr = build_fold_addr_expr (block_impl->destroy_helper_func_decl);
helper_addr = convert (ptr_type_node, helper_addr);
- initlist = tree_cons (fields, helper_addr, initlist);
+ CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, helper_addr);
}
for (chain = block_impl->block_original_ref_decl_list; chain;
chain = TREE_CHAIN (chain))
{
tree y = TREE_VALUE (chain);
TREE_USED (y) = 1;
- fields = TREE_CHAIN (fields);
- initlist = tree_cons (fields, copy_in_object (y), initlist);
+ CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, copy_in_object (y));
}
for (chain = block_impl->block_original_byref_decl_list; chain;
chain = TREE_CHAIN (chain))
{
tree y = TREE_VALUE (chain);
TREE_USED (y) = 1;
- fields = TREE_CHAIN (fields);
y = build_fold_addr_expr (y);
- initlist = tree_cons (fields, y, initlist);
+ CONSTRUCTOR_APPEND_ELT(v, NULL_TREE, y);
}
- return initlist;
+ return v;
}
+/* APPLE LOCAL end radar 6169527 */
/**
build_block_literal_tmp - This routine:
@@ -20758,7 +20779,7 @@
3) build the temporary initialization:
struct block_1 I = {
{ &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa,
- BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
+ BLOCK_HAS_CXX_OBJ | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags,
sizeof(struct block_1),
helper_1 },
copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE
@@ -20769,45 +20790,38 @@
It return the temporary.
*/
-
+/* APPLE LOCAL begin radar 6169527 */
static tree
build_block_literal_tmp (const char *name,
struct block_sema_info * block_impl)
{
extern tree create_tmp_var_raw (tree, const char *);
tree block_holder_tmp_decl;
- tree constructor, initlist;
- tree exp, bind;
+ tree constructor;
tree block_struct_type = TREE_TYPE (block_impl->block_arg_ptr_type);
block_holder_tmp_decl = create_tmp_var_raw (block_struct_type, name);
/* Context will not be known until when the literal is synthesized.
This is more so in the case of nested block literal blocks. */
+ maybe_push_decl (block_holder_tmp_decl);
DECL_CONTEXT (block_holder_tmp_decl) = current_function_decl;
DECL_ARTIFICIAL (block_holder_tmp_decl) = 1;
- initlist = build_block_struct_initlist (block_struct_type,
- block_impl);
- initlist = nreverse (initlist);
- constructor = build_constructor_from_list (block_struct_type,
- initlist);
- TREE_CONSTANT (constructor) = 1;
- TREE_STATIC (constructor) = 1;
- TREE_READONLY (constructor) = 1;
- DECL_INITIAL (block_holder_tmp_decl) = constructor;
- exp = build_stmt (DECL_EXPR, block_holder_tmp_decl);
- bind = build3 (BIND_EXPR, void_type_node, block_holder_tmp_decl, exp, NULL);
- TREE_SIDE_EFFECTS (bind) = 1;
- add_stmt (bind);
+ /* Create a CONSTRUCTOR to represent the braced-initializer. */
+ constructor = make_node (CONSTRUCTOR);
+
+ CONSTRUCTOR_ELTS (constructor) = build_block_struct_initlist (block_struct_type,
+ block_impl);
/* Temporary representing a global block is made global static. */
if (global_bindings_p ()) {
TREE_PUBLIC (block_holder_tmp_decl) = 0;
TREE_STATIC (block_holder_tmp_decl) = 1;
- finish_decl (block_holder_tmp_decl, constructor, NULL_TREE);
}
+ cp_finish_decl (block_holder_tmp_decl, constructor, 0, 0, LOOKUP_ONLYCONVERTING);
return block_holder_tmp_decl;
}
+/* APPLE LOCAL end radar 6169527 */
static tree
clean_and_exit (tree block)
@@ -20862,7 +20876,8 @@
stmt = begin_compound_stmt (BCS_FN_BODY);
for (chain = block_impl->block_ref_decl_list; chain;
chain = TREE_CHAIN (chain))
- if (block_requires_copying (TREE_VALUE (chain)))
+ /* APPLE LOCAL radar 6214617 */
+ if (cp_block_requires_copying (TREE_VALUE (chain)))
{
tree p = TREE_VALUE (chain);
tree dst_block_component, src_block_component;
@@ -20895,6 +20910,15 @@
call_exp = build_function_call (block_copy_assign_decl, func_params);
add_stmt (call_exp);
}
+ /* APPLE LOCAL begin radar 6214617 */
+ else if (TYPE_HAS_CONSTRUCTOR (TREE_TYPE (p))
+ || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (p)))
+ {
+ tree call_exp = build_aggr_init (dst_block_component, src_block_component,
+ LOOKUP_ONLYCONVERTING);
+ add_stmt (call_exp);
+ }
+ /* APPLE LOCAL end radar 6214617 */
else
{
/* _dest-> imported_object_x = [_src->imported_object_x retain] */
@@ -20931,7 +20955,8 @@
}
finish_compound_stmt (stmt);
- finish_function (0);
+ /* APPLE LOCAL radar 6169580 */
+ finish_function (4);
/* Hum, would be nice if someone else did this for us. */
if (global_bindings_p ())
cgraph_finalize_function (block_impl->copy_helper_func_decl, false);
@@ -20971,7 +20996,11 @@
stmt = begin_compound_stmt (BCS_FN_BODY);
for (chain = block_impl->block_ref_decl_list; chain;
chain = TREE_CHAIN (chain))
- if (block_requires_copying (TREE_VALUE (chain)))
+ /* APPLE LOCAL begin radar 6214617 */
+ if (block_requires_copying (TREE_VALUE (chain))
+ || (TREE_CODE (TREE_TYPE (TREE_VALUE (chain))) == RECORD_TYPE
+ && CLASSTYPE_DESTRUCTORS (TREE_TYPE (TREE_VALUE (chain)))))
+ /* APPLE LOCAL end radar 6214617 */
{
tree p = TREE_VALUE (chain);
tree src_block_component;
@@ -20999,6 +21028,15 @@
call_exp = build_function_call (block_destroy_decl, func_params);
add_stmt (call_exp);
}
+ /* APPLE LOCAL begin radar 6214617 */
+ else if (TREE_CODE (TREE_TYPE (p)) == RECORD_TYPE
+ && CLASSTYPE_DESTRUCTORS (TREE_TYPE (p)))
+ {
+ tree call_exp = cxx_maybe_build_cleanup (src_block_component);
+ gcc_assert (call_exp);
+ add_stmt (call_exp);
+ }
+ /* APPLE LOCAL end radar 6214617 */
else
{
tree rel_exp;
@@ -21030,7 +21068,8 @@
}
finish_compound_stmt (stmt);
- finish_function (0);
+ /* APPLE LOCAL radar 6169580 */
+ finish_function (4);
/* Hum, would be nice if someone else did this for us. */
if (global_bindings_p ())
cgraph_finalize_function (block_impl->destroy_helper_func_decl, false);
@@ -21056,13 +21095,31 @@
tree arg_type = void_list_node;
struct block_sema_info *block_impl;
tree tmp;
- tree restype, resdecl;
+ tree restype;
tree typelist;
tree helper_function_type;
tree block;
+ /* APPLE LOCAL radar 6185344 */
+ tree declared_block_return_type = NULL_TREE;
+ /* APPLE LOCAL radar 6169580 */
+ int context_is_nonstatic_method;
cp_lexer_consume_token (parser->lexer); /* eat '^' */
+ /* APPLE LOCAL begin radar 6185344 */
+ /* Parse user declared return type. */
+ if (!cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN) &&
+ !cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
+ {
+ tree type;
+ parsing_block_return_type = 1;
+ type = cp_parser_type_id (parser);
+ parsing_block_return_type = 0;
+ if (type != error_mark_node)
+ declared_block_return_type = type;
+ }
+ /* APPLE LOCAL end radar 6185344 */
+
/* Parse the optional argument list */
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
{
@@ -21088,9 +21145,21 @@
#endif
block = begin_block ();
+ /* APPLE LOCAL begin radar 6169580 */
+ context_is_nonstatic_method = (current_function_decl
+ && DECL_NONSTATIC_MEMBER_FUNCTION_P (current_function_decl));
+ /* APPLE LOCAL end radar 6169580 */
/* cur_block->arg_info = NULL; */
- cur_block->return_type = NULL_TREE;
+ /* APPLE LOCAL begin radar 6185344 */
+ if (declared_block_return_type)
+ {
+ cur_block->return_type = TYPE_MAIN_VARIANT (declared_block_return_type);
+ cur_block->block_has_return_type = true;
+ }
+ else
+ cur_block->return_type = NULL_TREE;
+ /* APPLE LOCAL end radar 6185344 */
if (args)
{
@@ -21124,19 +21193,24 @@
arg_type = tree_cons (NULL_TREE, ptr_type_node, arg_type);
arglist = self_arg;
- /* Build the declaration of the helper function (we do not know its result
- type yet, so assume it is 'void'). Treat this as a nested function and use
- nested function infrastructure for its generation. */
+ /* APPLE LOCAL begin radar 6185344 */
+ /* Build the declaration of the helper function (if we do not know its result
+ type yet, assume it is 'void'. If user provided it, use it).
+ Treat this as a nested function and use nested function infrastructure for
+ its generation. */
push_lang_context (lang_name_c);
- ftype = build_function_type (void_type_node, arg_type);
+
+ ftype = build_function_type ((!cur_block->block_has_return_type
+ ? void_type_node : cur_block->return_type),
+ arg_type);
+ /* APPLE LOCAL end radar 6185344 */
/* APPLE LOCAL radar 6160536 */
block_helper_function_decl = build_helper_func_decl (build_block_helper_name (unique_count),
ftype);
if (current_function_decl)
DECL_NO_STATIC_CHAIN (current_function_decl) = 0;
DECL_CONTEXT (block_helper_function_decl) = current_function_decl;
- BLOCK_HELPER_FUNC (block_helper_function_decl) = 1;
cur_block->helper_func_decl = block_helper_function_decl;
DECL_ARGUMENTS (block_helper_function_decl) = arglist;
@@ -21159,6 +21233,14 @@
/* Set block's scope to the scope of the helper function's main body.
This is primarily used when nested blocks are declared. */
cur_block->cp_the_scope = current_binding_level;
+ /* APPLE LOCAL begin radar 6169580 */
+ if (context_is_nonstatic_method)
+ {
+ tree this_decl = lookup_name (this_identifier);
+ gcc_assert (this_decl);
+ build_block_ref_decl (this_identifier, this_decl);
+ }
+ /* APPLE LOCAL end radar 6169580 */
cp_parser_compound_statement (parser, NULL, false, false);
parser->in_statement = save;
}
@@ -21175,11 +21257,9 @@
TREE_TYPE (self_arg) = cur_block->block_arg_ptr_type;
DECL_ARG_TYPE (self_arg) = cur_block->block_arg_ptr_type;
- /* Now that we know helper's result type, fix its result variable decl. */
- resdecl = build_decl (RESULT_DECL, NULL_TREE, restype);
- DECL_ARTIFICIAL (resdecl) = 1;
- DECL_IGNORED_P (resdecl) = 1;
- DECL_RESULT (current_function_decl) = resdecl;
+ /* The DECL_RESULT should already have the correct type by now. */
+ gcc_assert (TREE_TYPE (DECL_RESULT (current_function_decl))
+ == restype);
cur_block->block_body = stmt;
block_build_prologue (cur_block);
@@ -21202,12 +21282,7 @@
typelist);
helper_function_type = build_function_type (TREE_TYPE (ftype), typelist);
TREE_TYPE (cur_block->helper_func_decl) = helper_function_type;
- /* Let tree builder know that we are done analyzing block's return type so it
- does not do it twice (and produce bad return expression tree). This case is
- for global blocks as finish_function () for them builds AST for the entire
- body of the function. */
- cur_block->block_is_complete = true;
- finish_function (0);
+ finish_function (4);
pop_function_context ();
/* Hum, would be nice if someone else did this for us. */
if (global_bindings_p ())
@@ -21330,6 +21405,8 @@
/* FIXME - Broken, should be found via objc runtime testcases. */
/* FIXME - Don't use DECL_CONTEXT on any helpers */
tree ref_decl;
+ /* APPLE LOCAL radar 6212722 */
+ tree type, exp;
/* 'decl' was previously declared as __block. Simply, copy the value
embedded in the above variable. */
if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl))
@@ -21391,10 +21468,16 @@
}
}
}
-
+ /* APPLE LOCAL begin radar 6212722 */
+ exp = decl;
+ type = TREE_TYPE (exp);
+ if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == FUNCTION_TYPE) {
+ exp = decay_conversion (exp);
+ type = TREE_TYPE (exp);
+ }
ref_decl = build_decl (VAR_DECL, name,
- build_qualified_type (TREE_TYPE (decl),
- TYPE_QUAL_CONST));
+ build_qualified_type (type, TYPE_QUAL_CONST));
+ /* APPLE LOCAL end radar 6212722 */
/* APPLE LOCAL begin radar 6144664 */
DECL_SOURCE_LOCATION (ref_decl) = DECL_SOURCE_LOCATION
(cur_block->helper_func_decl);
@@ -21412,13 +21495,14 @@
while (b->level_chain->kind != sk_function_parms)
b = b->level_chain;
pushdecl_with_scope (ref_decl, b, /*is_friend=*/false);
- cp_finish_decl (ref_decl, NULL_TREE, /*init_const_expr_p=*/false, NULL_TREE,
- LOOKUP_ONLYCONVERTING);
+ /* APPLE LOCAL radar 6169527 */
+ add_decl_expr (ref_decl);
}
cur_block->block_ref_decl_list =
tree_cons (NULL_TREE, ref_decl, cur_block->block_ref_decl_list);
cur_block->block_original_ref_decl_list =
- tree_cons (NULL_TREE, decl, cur_block->block_original_ref_decl_list);
+ /* APPLE LOCAL radar 6212722 */
+ tree_cons (NULL_TREE, exp, cur_block->block_original_ref_decl_list);
return ref_decl;
}
@@ -21475,6 +21559,8 @@
TYPE_BLOCK_IMPL_STRUCT (invoke_impl_type) = 1;
/* finish_struct (invoke_impl_type, field_decl_chain, NULL_TREE); */
finish_builtin_struct (invoke_impl_type, "__invoke_impl", fields, NULL_TREE);
+ /* APPLE LOCAL radar 6169527 */
+ CLASSTYPE_AS_BASE (invoke_impl_type) = invoke_impl_type;
pop_from_top_level ();
invoke_impl_ptr_type = build_pointer_type (invoke_impl_type);
}
@@ -21497,11 +21583,6 @@
return ret;
}
-bool in_imm_block (void)
-{
- return (cur_block && cur_block->cp_the_scope == current_binding_level);
-}
-
/* This routine returns 'true' if 'name' has a declaration inside the
current block, 'false' otherwise. If 'name' has no declaration in
the current block, it returns in DECL the user declaration for
@@ -21556,13 +21637,16 @@
declare_block_prologue_local_vars - utility routine to do the actual
declaration and initialization for each referecned block variable.
*/
+/* APPLE LOCAL begin radar 6169527 */
+/* This routine is mostly rewritten for c++ because initialization of variables
+ may involve copy construction. */
static void
declare_block_prologue_local_vars (tree self_parm, tree component,
tree stmt)
{
tree decl, block_component;
tree_stmt_iterator i;
- tree decl_stmt;
+ tree initialization_stmt;
decl = component;
block_component = build_component_ref (build_indirect_ref (self_parm, "->"),
@@ -21573,6 +21657,35 @@
TREE_USED (decl) = 1;
DECL_CONTEXT (decl) = current_function_decl;
DECL_ARTIFICIAL (decl) = 1;
+ initialization_stmt = push_stmt_list();
+ cp_finish_decl (decl, block_component, 0, 0, LOOKUP_ONLYCONVERTING);
+ initialization_stmt = pop_stmt_list (initialization_stmt);
+ /* Prepend a initialization_stmt statement to the statement list. */
+ i = tsi_start (stmt);
+ tsi_link_before (&i, initialization_stmt, TSI_SAME_STMT);
+}
+
+/**
+ declare_block_prologue_local_byref_vars - utility routine to do the actual
+ declaration and initialization for each __block referenced block variable.
+ */
+static void
+declare_block_prologue_local_byref_vars (tree self_parm, tree component,
+ tree stmt)
+{
+ tree decl, block_component;
+ tree_stmt_iterator i;
+ tree decl_stmt;
+
+ decl = component;
+ block_component = build_component_ref (build_indirect_ref (self_parm, "->"),
+ DECL_NAME (component));
+ gcc_assert (block_component);
+ DECL_EXTERNAL (decl) = 0;
+ TREE_STATIC (decl) = 0;
+ TREE_USED (decl) = 1;
+ DECL_CONTEXT (decl) = current_function_decl;
+ DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = block_component;
/* Prepend a DECL_EXPR statement to the statement list. */
i = tsi_start (stmt);
@@ -21580,9 +21693,10 @@
SET_EXPR_LOCATION (decl_stmt, DECL_SOURCE_LOCATION (decl));
decl_stmt = build3 (BIND_EXPR, void_type_node, decl, decl_stmt, NULL);
TREE_SIDE_EFFECTS (decl_stmt) = 1;
-
- tsi_link_before (&i, decl_stmt, TSI_SAME_STMT);
+
+ tsi_link_before (&i, decl_stmt, TSI_SAME_STMT);
}
+/* APPLE LOCAL end radar 6169527 */
/**
block_build_prologue
@@ -21606,11 +21720,12 @@
chain = TREE_CHAIN (chain))
declare_block_prologue_local_vars (self_parm, TREE_VALUE (chain),
block_impl->block_body);
-
+ /* APPLE LOCAL begin radar 6169527 */
for (chain = block_impl->block_byref_decl_list; chain;
chain = TREE_CHAIN (chain))
- declare_block_prologue_local_vars (self_parm, TREE_VALUE (chain),
- block_impl->block_body);
+ declare_block_prologue_local_byref_vars (self_parm, TREE_VALUE (chain),
+ block_impl->block_body);
+ /* APPLE LOCAL end radar 6169527 */
}
/* APPLE LOCAL end blocks 6040305 (ch) */
Modified: llvm-gcc-4.2/trunk/gcc/cp/pt.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/pt.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/pt.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/pt.c Thu Sep 18 19:07:05 2008
@@ -5288,7 +5288,7 @@
pop_tinst_level ();
}
-/* LLVM LOCAL begin - Fix for GCC PR c++/29365 */
+/* APPLE LOCAL begin mainline radar 6194879 */
/* Returns the TINST_LEVEL which gives the original instantiation
context. */
@@ -5297,8 +5297,8 @@
{
return tree_last (current_tinst_level);
}
-/* LLVM LOCAL end */
+/* APPLE LOCAL end mainline radar 6194879 */
/* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the
vector of template arguments, as for tsubst.
@@ -7869,6 +7869,11 @@
complain);
}
+ /* APPLE LOCAL begin blocks 6204446 */
+ case BLOCK_POINTER_TYPE:
+ return t;
+ /* APPLE LOCAL end blocks 6204446 */
+
default:
sorry ("use of %qs in template",
tree_code_name [(int) TREE_CODE (t)]);
Modified: llvm-gcc-4.2/trunk/gcc/cp/rtti.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/rtti.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/rtti.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/rtti.c Thu Sep 18 19:07:05 2008
@@ -828,6 +828,10 @@
DECL_EXTERNAL (name_decl) = 0;
DECL_TINFO_P (name_decl) = 1;
set_linkage_according_to_type (target, name_decl);
+ /* APPLE LOCAL begin export basic tinfo names 5008927 */
+ if (doing_runtime && ! targetm.cxx.library_rtti_comdat ())
+ DECL_INTERFACE_KNOWN (name_decl) = 1;
+ /* APPLE LOCAL end export basic tinfo names 5008927 */
import_export_decl (name_decl);
DECL_INITIAL (name_decl) = name_string;
mark_used (name_decl);
Modified: llvm-gcc-4.2/trunk/gcc/cp/search.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/search.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/search.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/search.c Thu Sep 18 19:07:05 2008
@@ -1920,6 +1920,13 @@
int ix;
int found = 0;
+ /* APPLE LOCAL begin ctor name 6202462 */
+ /* A constructor doesn't have a name, so the concept of name lookup
+ of its name doesn't make sense. */
+ if (DECL_CONSTRUCTOR_P (fndecl))
+ return false;
+ /* APPLE LOCAL end ctor name 6202462 */
+
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
{
tree basetype = BINFO_TYPE (base_binfo);
Modified: llvm-gcc-4.2/trunk/gcc/cp/semantics.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/semantics.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/semantics.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/semantics.c Thu Sep 18 19:07:05 2008
@@ -774,12 +774,6 @@
expr = check_return_expr (expr, &no_warning);
- /* APPLE LOCAL begin blocks 6040305 */
- if (current_function_decl && BLOCK_HELPER_FUNC (current_function_decl)
- && !cur_block)
- return expr;
- /* APPLE LOCAL end blocks 6040305 */
-
if (flag_openmp && !check_omp_return ())
return error_mark_node;
if (!processing_template_decl)
@@ -2882,8 +2876,21 @@
Access checking has been performed during name lookup
already. Turn off checking to avoid duplicate errors. */
push_deferring_access_checks (dk_no_check);
- decl = finish_non_static_data_member (decl, current_class_ref,
- /*qualifying_scope=*/NULL_TREE);
+ /* APPLE LOCAL begin radar 6169580 */
+ if (cur_block)
+ {
+ tree exp;
+ tree this_copiedin_var = lookup_name (this_identifier);
+ gcc_assert (!current_class_ref);
+ gcc_assert (this_copiedin_var);
+ exp = build_x_arrow (this_copiedin_var);
+ decl = build_class_member_access_expr (exp, decl, TREE_TYPE (exp),
+ /*preserve_reference=*/false);
+ }
+ else
+ decl = finish_non_static_data_member (decl, current_class_ref,
+ /*qualifying_scope=*/NULL_TREE);
+ /* APPLE LOCAL end radar 6169580 */
pop_deferring_access_checks ();
}
else if (is_overloaded_fn (decl))
Modified: llvm-gcc-4.2/trunk/gcc/cp/typeck.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/typeck.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/cp/typeck.c (original)
+++ llvm-gcc-4.2/trunk/gcc/cp/typeck.c Thu Sep 18 19:07:05 2008
@@ -2775,6 +2775,7 @@
tree block_ptr_exp;
tree function_ptr_exp;
tree typelist;
+ tree result;
/* (struct invok_impl *)BLOCK_PTR_VAR */
/* First convert it to 'void *'. */
@@ -2792,8 +2793,11 @@
typelist = tree_cons (NULL_TREE, invoke_impl_ptr_type, typelist);
fntype = build_function_type (TREE_TYPE (fntype), typelist);
function_ptr_exp = convert (build_pointer_type (fntype), function_ptr_exp);
- return build3 (CALL_EXPR, TREE_TYPE (fntype),
- function_ptr_exp, params, NULL_TREE);
+ result = build3 (CALL_EXPR, TREE_TYPE (fntype),
+ function_ptr_exp, params, NULL_TREE);
+ /* FIXME: should do more from build_cxx_call */
+ result = convert_from_reference (result);
+ return result;
}
/* APPLE LOCAL end blocks 6040305 (cm) */
@@ -6982,59 +6986,70 @@
return NULL_TREE;
}
- if (processing_template_decl)
- {
- current_function_returns_value = 1;
- return retval;
- }
-
/* APPLE LOCAL begin blocks 6040305 (cm) */
- if (cur_block)
+ /* APPLE LOCAL radar 6185344 */
+ if (cur_block && !cur_block->block_has_return_type)
{
+ /* If this is the first return we've seen in the block, infer the type of
+ the block from it. */
if (cur_block->return_type == NULL_TREE)
{
if (retval)
- cur_block->return_type = TYPE_MAIN_VARIANT (TREE_TYPE (retval));
+ {
+ tree restype;
+ retval = decay_conversion (retval);
+ restype = TYPE_MAIN_VARIANT (TREE_TYPE (retval));
+ TREE_TYPE (current_function_decl)
+ = build_function_type (restype,
+ TYPE_ARG_TYPES (TREE_TYPE (current_function_decl)));
+ TREE_TYPE (DECL_RESULT (current_function_decl)) = restype;
+ relayout_decl (DECL_RESULT (current_function_decl));
+ cur_block->return_type = restype;
+ }
else
cur_block->return_type = void_type_node;
- /* FIXME - is this copy ctor safe? */
- return retval;
}
- /* Otherwise, verify that this result type matches the previous one. We are
- pickier with blocks than for normal functions because this is a new
- feature and we set the rules. */
+ /* Verify that this result type matches the previous one. We
+ are pickier with blocks than for normal functions because
+ this is a new feature and we set the rules. */
if (TREE_CODE (cur_block->return_type) == VOID_TYPE)
{
if (retval)
{
error ("void block should not return a value");
- retval = error_mark_node;
+ return error_mark_node;
}
- return retval;
}
-
- if (!retval)
+ else if (!retval)
{
error ("non-void block should return a value");
return error_mark_node;
}
- /* We have a non-void block with an expression, continue checking. */
- valtype = TREE_TYPE (retval);
+ if (retval)
+ {
+ /* We have a non-void block with an expression, continue checking. */
+ valtype = TREE_TYPE (retval);
- /* For now, restrict multiple return statements in a block to have
- strict compatible types only. */
- if (!types_are_block_compatible (cur_block->return_type, valtype))
- {
- error ("incompatible type returning %qT, expected %qT",
- valtype, cur_block->return_type);
- retval = error_mark_node;
+ /* For now, restrict multiple return statements in a block to have
+ strict compatible types only. */
+ if (!types_are_block_compatible (cur_block->return_type, valtype))
+ {
+ error ("incompatible type returning %qT, expected %qT",
+ valtype, cur_block->return_type);
+ return error_mark_node;
+ }
}
- return retval;
}
/* APPLE LOCAL end blocks 6040305 (cm) */
+ if (processing_template_decl)
+ {
+ current_function_returns_value = 1;
+ return retval;
+ }
+
/* When no explicit return-value is given in a function with a named
return value, the named return value is used. */
result = DECL_RESULT (current_function_decl);
@@ -7568,17 +7583,3 @@
return win;
}
-
-/* APPLE LOCAL begin blocks 6040305 */
-tree c_finish_return (tree exp)
-{
- /* Unlike c front-end, genericize gets called in the middle of
- block parsing. Must not convert the expression tree at that
- time. */
- if (cur_block)
- return exp;
- gcc_assert (current_function_decl
- && BLOCK_HELPER_FUNC (current_function_decl));
- return finish_return_stmt (exp);
-}
-/* APPLE LOCAL end blocks 6040305 */
Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original)
+++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Thu Sep 18 19:07:05 2008
@@ -214,8 +214,6 @@
typedef struct cfa_loc GTY(())
{
HOST_WIDE_INT offset;
- /* APPLE LOCAL async unwind info 5949350 */
- HOST_WIDE_INT fp_offset;
HOST_WIDE_INT base_offset;
unsigned int reg;
int indirect; /* 1 if CFA is accessed via a dereference. */
@@ -733,21 +731,6 @@
/* The last args_size we actually output. */
static HOST_WIDE_INT old_args_size;
-/* APPLE LOCAL begin async unwind info 5949350 */
-/* This routine should be called anytime the cfa.reg can be switched
- away from the fp. We record the offset used with the fp, so that
- if we go from using the fp to the sp and then update the sp from
- the fp, we know what offset to use instead of the current offset in
- use for the sp. */
-
-static inline void
-notice_cfa_fp_offset (void)
-{
- if (cfa.reg == (unsigned) HARD_FRAME_POINTER_REGNUM)
- cfa.fp_offset = cfa.offset;
-}
-/* APPLE LOCAL end async unwind info 5949350 */
-
/* Entry point to update the canonical frame address (CFA).
LABEL is passed to add_fde_cfi. The value of CFA is now to be
calculated from REG+OFFSET. */
@@ -758,8 +741,6 @@
dw_cfa_location loc;
loc.indirect = 0;
loc.base_offset = 0;
- /* APPLE LOCAL async unwind info 5949350 */
- notice_cfa_fp_offset ();
loc.reg = reg;
loc.offset = offset;
def_cfa_1 (label, &loc);
@@ -792,8 +773,6 @@
if (cfa_store.reg == loc.reg && loc.indirect == 0)
cfa_store.offset = loc.offset;
- /* APPLE LOCAL async unwind info 5949350 */
- notice_cfa_fp_offset ();
loc.reg = DWARF_FRAME_REGNUM (loc.reg);
lookup_cfa (&old_cfa);
@@ -1129,20 +1108,7 @@
insns to be marked, and to be able to handle saving state around
epilogues textually in the middle of the function. */
if (prologue_epilogue_contains (insn) || sibcall_epilogue_contains (insn))
- /* APPLE LOCAL begin async unwind info 5949350 */
- {
- if (!flag_asynchronous_unwind_tables)
- return;
-
- /* We now handle epilogues for flag_asynchronous_unwind_tables.
- We do this by saving the cfa information around the epilogue
- instructions and restoring that information after the
- epilogue instructions. See dwarf2out_frame_debug_noncall for
- the information that is saved and restored. */
- if (!epilogue_contains (insn))
- return;
- }
- /* APPLE LOCAL end async unwind info 5949350 */
+ return;
/* If only calls can throw, and we have a frame pointer,
save up adjustments until we see the CALL_INSN. */
@@ -1597,8 +1563,6 @@
case REG:
if (cfa.reg == (unsigned) REGNO (src))
{
- /* APPLE LOCAL async unwind info 5949350 */
- notice_cfa_fp_offset ();
/* Rule 1 */
/* Update the CFA rule wrt SP or FP. Make sure src is
relative to the current CFA register.
@@ -1645,24 +1609,8 @@
if (XEXP (src, 0) == hard_frame_pointer_rtx)
{
- /* APPLE LOCAL begin async unwind info 5949350 */
- /* In the epilogue, sometimes we switch from fp to
- sp and then play with sp, then do another switch
- from fp to sp. In order for this to work, we
- have to save a copy of the offset against fp, and
- restore that here, back into cfa.offset when we
- notice that we were using sp and not fp. */
- if (cfa.reg == (unsigned) STACK_POINTER_REGNUM)
- {
- cfa.reg = HARD_FRAME_POINTER_REGNUM;
- cfa.offset = cfa.fp_offset;
- }
- /* APPLE LOCAL end async unwind info 5949350 */
-
/* Restoring SP from FP in the epilogue. */
gcc_assert (cfa.reg == (unsigned) HARD_FRAME_POINTER_REGNUM);
- /* APPLE LOCAL async unwind info 5949350 */
- notice_cfa_fp_offset ();
cfa.reg = STACK_POINTER_REGNUM;
}
else if (GET_CODE (src) == LO_SUM)
@@ -1703,8 +1651,6 @@
&& REGNO (XEXP (src, 0)) == cfa.reg
&& GET_CODE (XEXP (src, 1)) == CONST_INT)
{
- /* APPLE LOCAL async unwind info 5949350 */
- notice_cfa_fp_offset ();
/* Setting a temporary CFA register that will be copied
into the FP later on. */
offset = - INTVAL (XEXP (src, 1));
@@ -1897,8 +1843,6 @@
x = XEXP (x, 0);
gcc_assert (REG_P (x));
- /* APPLE LOCAL async unwind info 5949350 */
- notice_cfa_fp_offset ();
cfa.reg = REGNO (x);
cfa.base_offset = offset;
cfa.indirect = 1;
@@ -1916,53 +1860,6 @@
}
}
-/* APPLE LOCAL begin async unwind info 5949350 */
-/* Mirror routine to dwarf2out_frame_debug_noncall, except this
- routine is only called for all non-CALL_P instructions and only
- before the instruction. We use this to save and restore the cfa
- state around epilogue instructions so that we can track frame
- related instructions from the epilogue when
- flag_asynchronous_unwind_tables is on. */
-void
-dwarf2out_frame_debug_noncall (bool inside_epilogue)
-{
- static dw_cfa_location saved_cfa;
- static dw_cfa_location saved_cfa_store;
- static dw_cfa_location saved_cfa_temp;
- static HOST_WIDE_INT saved_args_size;
-
- const char *label;
-
- if (inside_epilogue)
- {
- if (saved_cfa.reg == 0)
- {
- /* When we enter an epilogue, we save the current cfa so
- that we can restore it when we leave the epilogue. */
- saved_cfa = cfa;
- saved_cfa_store = cfa_store;
- saved_cfa_temp = cfa_temp;
- saved_args_size = args_size;
- }
- }
- else if (saved_cfa.reg != 0)
- {
- /* We have now left the epilogue, so restore the saved cfa. */
- cfa = saved_cfa;
- cfa_store = saved_cfa_store;
- cfa_temp = saved_cfa_temp;
- args_size = saved_args_size;
-
- label = dwarf2out_cfi_label ();
- def_cfa_1 (label, &cfa);
-
- /* Once restored, we might need to save it again. */
- saved_cfa.reg = 0;
- return;
- }
-}
-/* APPLE LOCAL end async unwind info 5949350 */
-
/* Record call frame debugging information for INSN, which either
sets SP or FP (adjusting how we calculate the frame address) or saves a
register to the stack. If INSN is NULL_RTX, initialize our state.
@@ -2012,14 +1909,19 @@
return;
}
- label = dwarf2out_cfi_label ();
- src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
- if (src)
- insn = XEXP (src, 0);
- else
- insn = PATTERN (insn);
+ /* APPLE LOCAL begin async unwind info 5976588 */
+ if (after_p)
+ {
+ label = dwarf2out_cfi_label ();
+ src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
+ if (src)
+ insn = XEXP (src, 0);
+ else
+ insn = PATTERN (insn);
- dwarf2out_frame_debug_expr (insn, label);
+ dwarf2out_frame_debug_expr (insn, label);
+ }
+ /* APPLE LOCAL end async unwind info 5976588 */
}
#endif
@@ -6714,9 +6616,7 @@
{
dw_die_ref c;
- if (! die->die_child)
- return;
-
+ /* APPLE LOCAL radar 6066486 - move code further down. */
/* APPLE LOCAL begin radar 5636185 */
/* As we are traversing the entire structure of dies, to add the
sibling attributes, also check each die to see if it has the
@@ -6736,6 +6636,13 @@
&& contained_in_subroutine (die))
remove_AT (die, DW_AT_MIPS_linkage_name);
/* APPLE LOCAL end radar 5636185 */
+ /* APPLE LOCAL begin radar 6066486 - Code moved from above. */
+ /* Don't return until after removing the DW_AT_MIPS_linkage_name,
+ if appropriate. */
+ if (! die->die_child)
+ return;
+ /* APPLE LOCAL end radar 6066486 */
+
if (die->die_parent && die != die->die_parent->die_child)
add_AT_die_ref (die, DW_AT_sibling, die->die_sib);
@@ -12258,7 +12165,12 @@
}
else
{
- subr_die = new_die (DW_TAG_subprogram, context_die, decl);
+ /* APPLE LOCAL begin radar 6193416 */
+ if (BLOCK_SYNTHESIZED_FUNC (decl))
+ subr_die = new_die (DW_TAG_subprogram, comp_unit_die, decl);
+ else
+ subr_die = new_die (DW_TAG_subprogram, context_die, decl);
+ /* APPLE LOCAL end radar 6193416 */
if (TREE_PUBLIC (decl))
add_AT_flag (subr_die, DW_AT_external, 1);
Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/dwarf2out.h (original)
+++ llvm-gcc-4.2/trunk/gcc/dwarf2out.h Thu Sep 18 19:07:05 2008
@@ -21,8 +21,6 @@
extern void dwarf2out_decl (tree);
extern void dwarf2out_frame_debug (rtx, bool);
-/* APPLE LOCAL async unwind info 5949350 */
-extern void dwarf2out_frame_debug_noncall (bool);
extern void debug_dwarf (void);
struct die_struct;
Modified: llvm-gcc-4.2/trunk/gcc/final.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/final.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/final.c (original)
+++ llvm-gcc-4.2/trunk/gcc/final.c Thu Sep 18 19:07:05 2008
@@ -1944,12 +1944,7 @@
case BARRIER:
#if defined (DWARF2_UNWIND_INFO)
if (dwarf2out_do_frame ())
- /* APPLE LOCAL begin async unwind info 5949350 */
- {
- dwarf2out_frame_debug_noncall (epilogue_contains (insn));
- dwarf2out_frame_debug (insn, false);
- }
- /* APPLE LOCAL end async unwind info 5949350 */
+ dwarf2out_frame_debug (insn, false);
#endif
break;
@@ -2534,10 +2529,6 @@
#if defined (DWARF2_UNWIND_INFO)
if (CALL_P (insn) && dwarf2out_do_frame ())
dwarf2out_frame_debug (insn, false);
- /* APPLE LOCAL begin async unwind info 5949350 */
- else if (dwarf2out_do_frame ())
- dwarf2out_frame_debug_noncall (epilogue_contains (insn));
- /* APPLE LOCAL end async unwind info 5949350 */
#endif
/* Find the proper template for this insn. */
Modified: llvm-gcc-4.2/trunk/gcc/function.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/function.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/function.c (original)
+++ llvm-gcc-4.2/trunk/gcc/function.c Thu Sep 18 19:07:05 2008
@@ -4731,16 +4731,6 @@
return 0;
}
-/* APPLE LOCAL begin async unwind info 5949350 */
-int
-epilogue_contains (rtx insn)
-{
- if (contains (insn, &epilogue))
- return 1;
- return 0;
-}
-/* APPLE LOCAL end async unwind info 5949350 */
-
int
prologue_epilogue_contains (rtx insn)
{
Modified: llvm-gcc-4.2/trunk/gcc/global.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/global.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/global.c (original)
+++ llvm-gcc-4.2/trunk/gcc/global.c Thu Sep 18 19:07:05 2008
@@ -690,33 +690,6 @@
mirror_conflicts ();
- /* APPLE LOCAL begin 4321079 */
- /* If two regs are tied by pseudo_preferences, and each is assigned to
- only once, they can share the same register even if their lifetimes
- overlap, as one must be a copy of the other. */
- {
- int i, j;
- for (i = max_allocno - 1; i >= 0; i--)
- {
- EXECUTE_IF_SET_IN_ALLOCNO_SET (pseudo_preferences
- + i * allocno_row_words,
- j,
- {
- if (REG_N_SETS (allocno[i].reg) == 1
- && REG_N_SETS (allocno[j].reg) == 1)
- {
- conflicts[(i) * allocno_row_words
- + (unsigned) (j) / INT_BITS]
- &= ~((INT_TYPE) 1 << ((unsigned) (j) % INT_BITS));
- conflicts[(j) * allocno_row_words
- + (unsigned) (i) / INT_BITS]
- &= ~((INT_TYPE) 1 << ((unsigned) (i) % INT_BITS));
- }
- });
- }
- }
- /* APPLE LOCAL end 4321079 */
-
/* Eliminate conflicts between pseudos and eliminable registers. If
the register is not eliminated, the pseudo won't really be able to
live in the eliminable register, so the conflict doesn't matter.
Modified: llvm-gcc-4.2/trunk/gcc/libgcc2.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/libgcc2.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/libgcc2.c (original)
+++ llvm-gcc-4.2/trunk/gcc/libgcc2.c Thu Sep 18 19:07:05 2008
@@ -2091,6 +2091,7 @@
#endif
}
+/* LLVM LOCAL */
#if defined(__i386__) && ! defined(_WINBASE_H)
extern int VirtualProtect (char *, int, int, int *) __attribute__((stdcall));
#endif
@@ -2126,6 +2127,7 @@
#endif
#endif /* L_trampoline */
+/* LLVM LOCAL */
#if !defined (__CYGWIN__) && !defined(__MINGW32__)
#ifdef L__main
Modified: llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple Thu Sep 18 19:07:05 2008
@@ -1,3 +1,33 @@
+2008-09-11 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 5839123
+ * objc-act.c (objc_compare_types): More detailed error
+ reporting.
+
+2008-09-10 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6209554
+ * objc-act.c (objc_declare_property_impl): Report on
+ location of previous property decl.
+ (error_previous_property_decl): New.
+
+2008-09-08 Fariborz Jahanian <fjahanian at apple.com>
+
+ Radar 6064186
+ * objc_act.c (generate_v2_property_list,
+ forward_declare_categories,
+ generate_descriptor_table,
+ generate_v2_ivars_list,
+ generate_dispatch_table,
+ generate_v2_dispatch_tables,
+ generate_v2_protocol_list,
+ generate_v2_method_descriptors,
+ newabi_append_ro,
+ generate_v2_shared_structures): Symbols which end up in DATA
+ section now start with "l_".
+ (build_message_reference_decl): Each message ref symbol is now prefixed
+ by "l_". It is also becomes 'private extern'.
+
2008-08-26 Fariborz Jahanian <fjahanian at apple.com>
Radar 5595325 (minor addition)
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=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Thu Sep 18 19:07:05 2008
@@ -2157,8 +2157,11 @@
tree decl, initlist;
int init_val = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_property_template));
- decl = start_var_decl (type, synth_id_with_class_suffix
- (name, objc_implementation_context));
+ /* APPLE LOCAL begin radar 6064186 */
+ const char * ref_name = synth_id_with_class_suffix (name, objc_implementation_context);
+ decl = start_var_decl (type, ref_name);
+ set_user_assembler_name (decl, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, init_val));
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, size), initlist);
@@ -2932,8 +2935,10 @@
name of property meta-data is unique for each case. */
UOBJC_V2_PROPERTY_decl = generate_v2_property_list (
property_list_template,
- protocol ? "_OBJC_$_PROP_PROTO_LIST"
- : "_OBJC_$_PROP_LIST",
+ /* APPLE LOCAL begin radar 6064186 */
+ protocol ? "l_OBJC_$_PROP_PROTO_LIST"
+ : "l_OBJC_$_PROP_LIST",
+ /* APPLE LOCAL end radar 6064186 */
size, initlist);
}
@@ -3784,25 +3789,33 @@
return false;
/* APPLE LOCAL end 4175534 */
+ /* APPLE LOCAL begin radar 5839123 */
case -3:
- warning (0, "comparison of distinct Objective-C types lacks a cast");
+ warning (0, "comparison of distinct Objective-C types %qT and %qT lacks a cast",
+ orig_rtyp, orig_ltyp);
break;
case -2:
- warning (0, "initialization from distinct Objective-C type");
+ warning (0, "incompatible Objective-C types initializing %qT, expected %qT",
+ orig_rtyp, orig_ltyp);
break;
case -1:
- warning (0, "assignment from distinct Objective-C type");
+ warning (0, "incompatible Objective-C types assigning %qT, expected %qT",
+ orig_rtyp, orig_ltyp);
break;
case 0:
- warning (0, "distinct Objective-C type in return");
+ warning (0, "incompatible Objective-C types returning %qT, expected %qT",
+ orig_rtyp, orig_ltyp);
break;
default:
- warning (0, "passing argument %d of %qE from distinct "
- "Objective-C type", argno, callee);
+ warning (0, "incompatible Objective-C types %qT, expected %qT when"
+ " passing argument %d of %qE from distinct "
+ "Objective-C type"
+ , orig_rtyp, orig_ltyp, argno, callee);
+ /* APPLE LOCAL end radar 5839123 */
break;
}
}
@@ -5297,10 +5310,14 @@
/* APPLE LOCAL begin new ObjC abi v2 */
if (flag_objc_abi == 2)
{
- /* extern struct category_t _OBJC_$_CATEGORY_<name>; */
- impent->class_v2_decl = build_metadata_decl ("_OBJC_$_CATEGORY",
+ /* APPLE LOCAL begin radar 6064186 */
+ /* extern struct category_t l_OBJC_$_CATEGORY_<name>; */
+ impent->class_v2_decl = build_metadata_decl ("l_OBJC_$_CATEGORY",
/* APPLE LOCAL radar 5202926 */
objc_v2_category_template, false);
+ set_user_assembler_name (impent->class_v2_decl,
+ IDENTIFIER_POINTER (DECL_NAME (impent->class_v2_decl)));
+ /* APPLE LOCAL end radar 6064186 */
}
else
{
@@ -5977,22 +5994,36 @@
static GTY(()) int message_reference_idx;
+/* APPLE LOCAL begin radar 5575115 - radar 6064186 */
static tree
-build_message_reference_decl (void)
+build_message_reference_decl (tree sel_name, tree message_func_ident)
{
tree decl;
- char buf[256];
+ char *buf;
+ char *temp;
+ int fixed_prefix_size =
+ 2 + IDENTIFIER_LENGTH (message_func_ident) + 1;
+ buf = (char *)alloca (fixed_prefix_size +
+ strlen (IDENTIFIER_POINTER (sel_name)) + 1);
+ sprintf (buf, "l_%s_%s", IDENTIFIER_POINTER (message_func_ident),
+ IDENTIFIER_POINTER (sel_name));
+ for (temp = buf+fixed_prefix_size; *temp; temp++)
+ if (*temp == ':') *temp = '_';
- sprintf (buf, "_OBJC_MESSAGE_REF_%d", message_reference_idx++);
- decl = start_var_decl (objc_v2_message_ref_template, buf);
+ decl = create_hidden_decl (objc_v2_message_ref_template, buf);
+ DECL_WEAK (decl) = 1;
+ /* LLVM LOCAL begin */
#ifdef ENABLE_LLVM
- /* These are 4-byte aligned in 32-byte, 16-byte in 64-bit, which does not
+ /* These are 4-byte aligned in 32-bit, 16-byte in 64-bit, which does not
follow from the alignments of the component types. */
DECL_ALIGN(decl) = BITS_PER_WORD==32 ? 32 : 128;
DECL_USER_ALIGN(decl) = 1;
#endif
+ /* LLVM LOCAL end */
+ set_user_assembler_name (decl, buf);
return decl;
}
+/* APPLE LOCAL end radar 5575115 - radar 6064186 */
/* Build the list of (objc_msgSend_fixup_xxx, selector name) Used later on to
initialize the table of 'struct message_ref_t' elements. */
@@ -6013,7 +6044,8 @@
chain = &TREE_CHAIN (*chain);
}
- mess_expr = build_message_reference_decl ();
+ /* APPLE LOCAL radar 5575115 - radar 6064186 */
+ mess_expr = build_message_reference_decl (sel_name, DECL_NAME (message_func_decl));
*chain = tree_cons (mess_expr, message_func_decl, NULL_TREE);
chain = &TREE_CHAIN (*chain);
@@ -9258,13 +9290,17 @@
tree proto, bool newabi)
{
tree decl, initlist;
-
- decl = start_var_decl (type, synth_id_with_class_suffix (name, proto));
+ /* APPLE LOCAL begin radar 6064186 */
+ const char* ref_name = synth_id_with_class_suffix (name, proto);
+ decl = start_var_decl (type, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
/* APPLE LOCAL begin ObjC new abi */
if (newabi)
{
int entsize;
+ /* APPLE LOCAL radar 6064186 */
+ set_user_assembler_name (decl, ref_name);
entsize = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_method_template));
initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, entsize));
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, size), initlist);
@@ -10995,9 +11031,11 @@
int size, tree list)
{
tree decl, initlist;
-
- decl = start_var_decl (type, synth_id_with_class_suffix
- (name, objc_implementation_context));
+ /* APPLE LOCAL begin radar 6064186 */
+ const char *ref_name = synth_id_with_class_suffix (name, objc_implementation_context);
+ decl = start_var_decl (type, ref_name);
+ set_user_assembler_name (decl, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, ivar_t_size));
@@ -11052,7 +11090,8 @@
objc_v2_ivar_template, chain);
UOBJC_V2_INSTANCE_VARIABLES_decl
- = generate_v2_ivars_list (ivar_list_template, "_OBJC_$_INSTANCE_VARIABLES",
+ /* APPLE LOCAL radar 6064186 */
+ = generate_v2_ivars_list (ivar_list_template, "l_OBJC_$_INSTANCE_VARIABLES",
TREE_INT_CST_LOW (
TYPE_SIZE_UNIT (objc_v2_ivar_template)),
size, initlist);
@@ -11197,8 +11236,12 @@
? TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_method_template))
: 0;
/* APPLE LOCAL end ObjC new abi */
- decl = start_var_decl (type, synth_id_with_class_suffix
- (name, objc_implementation_context));
+ /* APPLE LOCAL begin radar 6064186 */
+ const char* ref_name = synth_id_with_class_suffix (name, objc_implementation_context);
+ decl = start_var_decl (type, ref_name);
+ if (newabi)
+ set_user_assembler_name (decl, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
/* LLVM LOCAL - begin make initializer size match type size */
/* APPLE LOCAL ObjC new abi */
@@ -11328,8 +11371,10 @@
= generate_dispatch_table (method_list_template,
((TREE_CODE (objc_implementation_context)
== CLASS_IMPLEMENTATION_TYPE)
- ? "_OBJC_$_CLASS_METHODS"
- : "_OBJC_$_CATEGORY_CLASS_METHODS"),
+ /* APPLE LOCAL begin radar 6064186 */
+ ? "l_OBJC_$_CLASS_METHODS"
+ : "l_OBJC_$_CATEGORY_CLASS_METHODS"),
+ /* APPLE LOCAL end radar 6064186 */
size, initlist, true);
}
else
@@ -11348,13 +11393,15 @@
if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
UOBJC_V2_INSTANCE_METHODS_decl
= generate_dispatch_table (method_list_template,
- "_OBJC_$_INSTANCE_METHODS",
+ /* APPLE LOCAL radar 6064186 */
+ "l_OBJC_$_INSTANCE_METHODS",
size, initlist, true);
else
/* We have a category. */
UOBJC_V2_INSTANCE_METHODS_decl
= generate_dispatch_table (method_list_template,
- "_OBJC_$_CATEGORY_INSTANCE_METHODS",
+ /* APPLE LOCAL radar 6064186 */
+ "l_OBJC_$_CATEGORY_INSTANCE_METHODS",
size, initlist, true);
}
else
@@ -11404,12 +11451,13 @@
/* static struct protocol_list_t *list[size]; */
+ /* APPLE LOCAL begin radar 6064186 */
if (TREE_CODE (i_or_p) == PROTOCOL_INTERFACE_TYPE)
- ref_name = synth_id_with_class_suffix ("_OBJC_$_PROTOCOL_REFS", i_or_p);
+ ref_name = synth_id_with_class_suffix ("l_OBJC_$_PROTOCOL_REFS", i_or_p);
else if (TREE_CODE (i_or_p) == CLASS_INTERFACE_TYPE)
- ref_name = synth_id_with_class_suffix ("_OBJC_CLASS_PROTOCOLS_$", i_or_p);
+ ref_name = synth_id_with_class_suffix ("l_OBJC_CLASS_PROTOCOLS_$", i_or_p);
else if (TREE_CODE (i_or_p) == CATEGORY_INTERFACE_TYPE)
- ref_name = synth_id_with_class_suffix ("_OBJC_CATEGORY_PROTOCOLS_$", i_or_p);
+ ref_name = synth_id_with_class_suffix ("l_OBJC_CATEGORY_PROTOCOLS_$", i_or_p);
else
abort ();
@@ -11418,6 +11466,8 @@
(build_pointer_type (objc_v2_protocol_template),
build_index_type (build_int_cst (NULL_TREE, size))),
ref_name);
+ set_user_assembler_name (refs_decl, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
finish_var_decl (refs_decl, objc_build_constructor (TREE_TYPE (refs_decl),
nreverse (initlist)));
@@ -11494,12 +11544,14 @@
if (is_optional)
UOBJC_PROTOCOL_OPT_CLS_METHODS_decl
= generate_descriptor_table (method_list_template,
- "_OBJC_$_PROTOCOL_CLASS_METHODS_OPT",
+ /* APPLE LOCAL radar 6064186 */
+ "l_OBJC_$_PROTOCOL_CLASS_METHODS_OPT",
size, initlist, protocol, true);
else
UOBJC_V2_CLASS_METHODS_decl
= generate_descriptor_table (method_list_template,
- "_OBJC_$_PROTOCOL_CLASS_METHODS",
+ /* APPLE LOCAL radar 6064186 */
+ "l_OBJC_$_PROTOCOL_CLASS_METHODS",
size, initlist, protocol, true);
}
else
@@ -11524,12 +11576,14 @@
if (is_optional)
UOBJC_PROTOCOL_OPT_NST_METHODS_decl
= generate_descriptor_table (method_list_template,
- "_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT",
+ /* APPLE LOCAL radar 6064186 */
+ "l_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT",
size, initlist, protocol, true);
else
UOBJC_V2_INSTANCE_METHODS_decl
= generate_descriptor_table (method_list_template,
- "_OBJC_$_PROTOCOL_INSTANCE_METHODS",
+ /* APPLE LOCAL radar 6064186 */
+ "l_OBJC_$_PROTOCOL_INSTANCE_METHODS",
size, initlist, protocol, true);
}
else
@@ -12017,6 +12071,8 @@
dollar = strchr (name, '$');
gcc_assert (dollar);
p = string;
+ /* APPLE LOCAL radar 6064186 */
+ *p = 'l'; p++;
*p = '_'; p++;
strncpy (p, name, (int)(dollar - name));
p += (int)(dollar - name);
@@ -12390,6 +12446,8 @@
tree field, firstIvar;
tree class_superclass_expr, metaclass_superclass_expr;
unsigned int flags = 0x1; /* Start with CLS_META */
+ /* APPLE LOCAL radar 6064186 */
+ const char* ref_name;
/* APPLE LOCAL begin radar 4705298, 4843145 */
class_decl = objc_create_global_decl_for_class (
objc_v2_class_template,
@@ -12497,9 +12555,12 @@
sc_spec = build_tree_list (NULL_TREE, ridpointers[(int) RID_STATIC]);
decl_specs = tree_cons (NULL_TREE, objc_v2_class_ro_template, sc_spec);
- decl = start_var_decl (objc_v2_class_ro_template,
- newabi_append_ro (IDENTIFIER_POINTER
- (DECL_NAME (UOBJC_V2_METACLASS_decl))));
+ /* APPLE LOCAL begin radar 6064186 */
+ ref_name = newabi_append_ro (
+ IDENTIFIER_POINTER (DECL_NAME (UOBJC_V2_METACLASS_decl)));
+ decl = start_var_decl (objc_v2_class_ro_template, ref_name);
+ set_user_assembler_name (decl, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
initlist = build_class_ro_t_initializer
(TREE_TYPE (decl),
@@ -12575,9 +12636,11 @@
: instanceSize;
/* APPLE LOCAL end ARM signedness mismatch */
- decl = start_var_decl (objc_v2_class_ro_template,
- newabi_append_ro (IDENTIFIER_POINTER
- (DECL_NAME (UOBJC_V2_CLASS_decl))));
+ /* APPLE LOCAL begin radar 6064186 */
+ ref_name = newabi_append_ro (IDENTIFIER_POINTER (DECL_NAME (UOBJC_V2_CLASS_decl)));
+ decl = start_var_decl (objc_v2_class_ro_template, ref_name);
+ set_user_assembler_name (decl, ref_name);
+ /* APPLE LOCAL end radar 6064186 */
/* APPLE LOCAL begin radar 4695101 */
ivarLayout = objc_build_ivar_layout (true);
@@ -19804,6 +19867,13 @@
/* APPLE LOCAL end radar 5435299 */
+/* APPLE LOCAL begin radar 6209554 */
+static void error_previous_property_decl (tree x)
+{ tree decl = build_decl (VAR_DECL, DECL_NAME (x), TREE_TYPE (x));
+ DECL_SOURCE_LOCATION (decl) = DECL_SOURCE_LOCATION (x);
+ error ("previous property declaration of %q+D was here", decl);
+}
+/* APPLE LOCAL end radar 6209554 */
/* This routine declares a new property implementation. Triggered by a @synthesize or
@dynamic declaration. */
void objc_declare_property_impl (int impl_code, tree tree_list)
@@ -19950,24 +20020,30 @@
}
}
}
- /* APPLE LOCAL begin radar 5435299 */
+ /* APPLE LOCAL begin radar 5435299 - radar 6209554 */
else if (flag_new_property_ivar_synthesis)
objc_lookup_property_ivar (class, property_decl);
if (flag_new_property_ivar_synthesis &&
(x = lookup_ivar_in_property_list (objc_implementation_context,
ivar_name)))
- error ("synthesized properties %qs and %qs both claim ivar %qs",
- IDENTIFIER_POINTER (property_name),
- IDENTIFIER_POINTER (DECL_NAME (x)),
- IDENTIFIER_POINTER (ivar_name));
- /* APPLE LOCAL end radar 5435299 */
+ {
+ error ("synthesized properties %qs and %qs both claim ivar %qs",
+ IDENTIFIER_POINTER (property_name),
+ IDENTIFIER_POINTER (DECL_NAME (x)),
+ IDENTIFIER_POINTER (ivar_name));
+ error_previous_property_decl (x);
+ }
+ /* APPLE LOCAL end radar 5435299 - radar 6209554 */
}
- /* APPLE LOCAL begin radar 5435299 */
+ /* APPLE LOCAL begin radar 5435299 - radar 6209554 */
if (flag_new_property_ivar_synthesis &&
- lookup_property_impl_in_list (objc_implementation_context, property_name))
- error ("property %qs is already implemented",
- IDENTIFIER_POINTER (property_name));
- /* APPLE LOCAL end radar 5435299 */
+ (x = lookup_property_impl_in_list (objc_implementation_context, property_name)))
+ {
+ error ("property %qs is already implemented",
+ IDENTIFIER_POINTER (property_name));
+ error_previous_property_decl (x);
+ }
+ /* APPLE LOCAL end radar 5435299 - radar 6209554 */
/* Add the property to the list of properties for current implementation. */
TREE_CHAIN (property_decl) = IMPL_PROPERTY_DECL (objc_implementation_context);
IMPL_PROPERTY_DECL (objc_implementation_context) = property_decl;
Modified: llvm-gcc-4.2/trunk/gcc/reload1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/reload1.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/reload1.c (original)
+++ llvm-gcc-4.2/trunk/gcc/reload1.c Thu Sep 18 19:07:05 2008
@@ -2695,7 +2695,11 @@
case CLOBBER:
case ASM_OPERANDS:
+ /* APPLE LOCAL begin async unwind info 5976588 */
+ gcc_unreachable ();
case SET:
+ break;
+ /* APPLE LOCAL end async unwind info 5976588 */
gcc_unreachable ();
default:
Modified: llvm-gcc-4.2/trunk/gcc/rtl.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/rtl.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/rtl.h (original)
+++ llvm-gcc-4.2/trunk/gcc/rtl.h Thu Sep 18 19:07:05 2008
@@ -2143,8 +2143,6 @@
/* In function.c */
extern void reposition_prologue_and_epilogue_notes (rtx);
extern void thread_prologue_and_epilogue_insns (rtx);
- /* APPLE LOCAL async unwind info 5949350 */
-extern int epilogue_contains (rtx);
extern int prologue_epilogue_contains (rtx);
extern int sibcall_epilogue_contains (rtx);
extern void mark_temp_addr_taken (rtx);
Modified: llvm-gcc-4.2/trunk/gcc/sched-deps.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/sched-deps.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/sched-deps.c (original)
+++ llvm-gcc-4.2/trunk/gcc/sched-deps.c Thu Sep 18 19:07:05 2008
@@ -2132,6 +2132,7 @@
return ds;
}
+/* LLVM LOCAL */
#endif
#ifdef INSN_SCHEDULING
Modified: llvm-gcc-4.2/trunk/gcc/tree-ssa-alias.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-ssa-alias.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree-ssa-alias.c (original)
+++ llvm-gcc-4.2/trunk/gcc/tree-ssa-alias.c Thu Sep 18 19:07:05 2008
@@ -1502,6 +1502,8 @@
{
size_t i;
tree ptr;
+ /* APPLE LOCAL 6070085 */
+ bool more;
/* Sort the POINTERS array in descending order of contributed
virtual operands. */
@@ -1523,26 +1525,38 @@
/* See if TAG1 had any aliases in common with other symbol tags.
If we find a TAG2 with common aliases with TAG1, add TAG2's
aliases into TAG1. */
- for (j = i + 1; j < ai->num_pointers; j++)
- {
- bitmap tag2_aliases = ai->pointers[j]->may_aliases;
+ /* APPLE LOCAL begin 6070085 */
+ do {
+ /* Repeat alias merging until changes converge. */
+ more = false;
+ for (j = i + 1; j < ai->num_pointers; j++)
+ {
+ bitmap tag2_aliases;
- if (bitmap_intersect_p (tag1_aliases, tag2_aliases))
- {
- tree tag2 = var_ann (ai->pointers[j]->var)->symbol_mem_tag;
+ if (ai->pointers[j]->grouped_p)
+ continue;
- bitmap_ior_into (tag1_aliases, tag2_aliases);
+ tag2_aliases = ai->pointers[j]->may_aliases;
- /* TAG2 does not need its aliases anymore. */
- bitmap_clear (tag2_aliases);
- var_ann (tag2)->may_aliases = NULL;
+ if (bitmap_intersect_p (tag1_aliases, tag2_aliases))
+ {
+ tree tag2 = var_ann (ai->pointers[j]->var)->symbol_mem_tag;
- /* TAG1 is the unique alias of TAG2. */
- add_may_alias (tag2, tag1);
+ bitmap_ior_into (tag1_aliases, tag2_aliases);
- ai->pointers[j]->grouped_p = true;
- }
- }
+ /* TAG2 does not need its aliases anymore. */
+ bitmap_clear (tag2_aliases);
+ var_ann (tag2)->may_aliases = NULL;
+
+ /* TAG1 is the unique alias of TAG2. */
+ add_may_alias (tag2, tag1);
+
+ ai->pointers[j]->grouped_p = true;
+ more = true;
+ }
+ }
+ } while (more);
+ /* APPLE LOCAL end 6070085 */
/* Now group all the aliases we collected into TAG1. */
group_aliases_into (tag1, tag1_aliases, ai);
Modified: llvm-gcc-4.2/trunk/gcc/tree.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.h (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.h Thu Sep 18 19:07:05 2008
@@ -3062,8 +3062,6 @@
ENUM_BITFIELD(tls_model) tls_model : 3;
/* APPLE LOCAL begin radar 5732232 - blocks */
- /* Belongs to FUNCTION_DECL exclusively. */
- unsigned block_helper_func : 1;
/* Belong to VAR_DECL exclusively. */
unsigned block_decl_byref : 1;
unsigned block_decl_copied : 1;
@@ -3072,7 +3070,7 @@
unsigned copyable_byref_local_nonpod : 1;
/* APPLE LOCAL radar 6172148 */
unsigned block_synthesized_function : 1;
- /* 5 unused bits. */
+ /* 6 unused bits. */
/* APPLE LOCAL end radar 5932809 - copyable byref blocks */
/* APPLE LOCAL end radar 5732232 - blocks */
};
@@ -3121,7 +3119,6 @@
#define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
/* APPLE LOCAL begin radar 5732232 - blocks */
-#define BLOCK_HELPER_FUNC(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.block_helper_func)
#define BLOCK_DECL_BYREF(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_byref)
#define BLOCK_DECL_COPIED(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_copied)
/* APPLE LOCAL end radar 5732232 - blocks */
Modified: llvm-gcc-4.2/trunk/gcc/version.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=56322&r1=56321&r2=56322&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/version.c (original)
+++ llvm-gcc-4.2/trunk/gcc/version.c Thu Sep 18 19:07:05 2008
@@ -11,12 +11,12 @@
/* APPLE LOCAL begin Apple version */
#ifdef ENABLE_LLVM
#ifdef LLVM_VERSION_INFO
-#define VERSUFFIX " (Based on Apple Inc. build 5620) (LLVM build " LLVM_VERSION_INFO ")"
+#define VERSUFFIX " (Based on Apple Inc. build 5622) (LLVM build " LLVM_VERSION_INFO ")"
#else
-#define VERSUFFIX " (Based on Apple Inc. build 5620) (LLVM build)"
+#define VERSUFFIX " (Based on Apple Inc. build 5622) (LLVM build)"
#endif
#else
-#define VERSUFFIX " (Based on Apple Inc. build 5620)"
+#define VERSUFFIX " (Based on Apple Inc. build 5622)"
#endif
/* APPLE LOCAL end Apple version */
More information about the llvm-commits
mailing list