diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1996-09-18 17:20:21 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1996-09-18 17:20:21 +0000 |
commit | 7fcdf4c26b5181466cec06573b45580eb686a22b (patch) | |
tree | fc47233cd08ae0a07b5e0ae900f6f6a42caae953 /gcc | |
parent | 4a1b3b10c8913cdcbae077b495891c80aef72796 (diff) | |
download | gcc-7fcdf4c26b5181466cec06573b45580eb686a22b.zip gcc-7fcdf4c26b5181466cec06573b45580eb686a22b.tar.gz gcc-7fcdf4c26b5181466cec06573b45580eb686a22b.tar.bz2 |
89th Cygnus<->FSF quick merge
From-SVN: r12738
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 33 | ||||
-rw-r--r-- | gcc/cp/call.c | 12 | ||||
-rw-r--r-- | gcc/cp/decl.c | 65 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 37 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/cp/mpw-make.sed | 10 |
6 files changed, 87 insertions, 72 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 729132e..1888c1b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,36 @@ +Wed Sep 18 04:24:07 1996 Jason Merrill <jason@yorick.cygnus.com> + + * method.c (make_thunk): Call comdat_linkage before setting the + TREE_CODE. + + * decl2.c (comdat_linkage): Use make_decl_one_only. + (import_export_decl): Likewise. + * decl.c (init_decl_processing): Check supports_one_only instead of + SUPPORTS_WEAK. + +Sat Sep 14 08:34:41 1996 Jason Merrill <jason@yorick.cygnus.com> + + * decl2.c (grokfield): Tighten checking for access decls. + + * decl.c (make_typename_type): Resolve references to + current_class_type. Set CLASSTYPE_GOT_SEMICOLON. + (lookup_name_real): Types that depend on a template parameter get + an implicit 'typename' unless they're in the current scope. + (start_decl_1): We don't care about incomplete types that depend + on a template parm. + (grokdeclarator): Resolve 'typename's in the type specifier that + refer to members of the current scope. + + * call.c (build_over_call): Remove 'inline called before + definition' diagnostic. + (build_method_call): Likewise. + * decl.c (duplicate_decls): Downgrade 'used before declared + inline' to a warning, only with -Winline. + +Fri Sep 13 17:31:40 1996 Stan Shebs <shebs@andros.cygnus.com> + + * mpw-make.sed: Fix include paths, add @DASH_C_FLAG@ to compile. + Wed Sep 11 22:38:13 1996 Gerald Baumgartner <gb@cs.purdue.edu> * call.c (build_method_call): When calling a signature diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 06580be..0b749f6 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2449,12 +2449,6 @@ build_method_call (instance, name, parms, basetype_path, flags) function = DECL_MAIN_VARIANT (function); mark_used (function); - if (pedantic && DECL_THIS_INLINE (function) && ! DECL_ARTIFICIAL (function) - && ! DECL_INITIAL (function) && ! DECL_PENDING_INLINE_INFO (function) - && ! (DECL_TEMPLATE_INFO (function) - && TREE_LANG_FLAG_0 (DECL_TEMPLATE_INFO (function)))) - cp_warning ("inline function `%#D' called before definition", function); - fntype = TREE_TYPE (function); if (TREE_CODE (fntype) == POINTER_TYPE) fntype = TREE_TYPE (fntype); @@ -5123,12 +5117,6 @@ build_over_call (fn, convs, args, flags) mark_used (fn); - if (pedantic && DECL_THIS_INLINE (fn) && ! DECL_ARTIFICIAL (fn) - && ! DECL_INITIAL (fn) && ! DECL_PENDING_INLINE_INFO (fn) - && ! (DECL_TEMPLATE_INFO (fn) - && TREE_LANG_FLAG_0 (DECL_TEMPLATE_INFO (fn)))) - cp_warning ("inline function `%#D' called before definition", fn); - if (DECL_CONTEXT (fn) && IS_SIGNATURE (DECL_CONTEXT (fn))) return build_signature_method_call (fn, converted_args); else if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ad34c90..01af1a5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2594,27 +2594,13 @@ duplicate_decls (newdecl, olddecl) } } - if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl)) + if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl) + && TREE_ADDRESSABLE (olddecl) && warn_inline) { -#if 0 /* I think this will be correct, but it's really annoying. We should - fix the compiler to find vtables by indirection so it isn't - necessary. (jason 8/25/95) */ - if (DECL_VINDEX (olddecl) && ! DECL_ABSTRACT_VIRTUAL_P (olddecl)) - { - cp_pedwarn ("virtual function `%#D' redeclared inline", - newdecl); - cp_pedwarn_at ("previous non-inline declaration here", - olddecl); - } - else -#endif - if (TREE_ADDRESSABLE (olddecl)) - { - cp_pedwarn ("`%#D' was used before it was declared inline", - newdecl); - cp_pedwarn_at ("previous non-inline declaration here", - olddecl); - } + cp_warning ("`%#D' was used before it was declared inline", + newdecl); + cp_warning_at ("previous non-inline declaration here", + olddecl); } } /* These bits are logically part of the type for non-functions. */ @@ -2796,9 +2782,7 @@ duplicate_decls (newdecl, olddecl) /* Merge the storage class information. */ DECL_WEAK (newdecl) |= DECL_WEAK (olddecl); -#ifdef DECL_ONE_ONLY DECL_ONE_ONLY (newdecl) |= DECL_ONE_ONLY (olddecl); -#endif TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl); TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl); if (! DECL_EXTERNAL (olddecl)) @@ -4329,7 +4313,8 @@ make_typename_type (context, name) my_friendly_abort (2000); if (! current_template_parms - || ! uses_template_parms (context)) + || ! uses_template_parms (context) + || context == current_class_type) { t = lookup_field (context, name, 0, 1); if (t == NULL_TREE) @@ -4350,6 +4335,7 @@ make_typename_type (context, name) TYPE_CONTEXT (t) = context; TYPE_MAIN_DECL (TREE_TYPE (d)) = d; DECL_CONTEXT (d) = context; + CLASSTYPE_GOT_SEMICOLON (t) = 1; return t; } @@ -4434,8 +4420,9 @@ lookup_name_real (name, prefer_type, nonclass) else val = NULL_TREE; -#if 0 +#if 1 if (got_scope && current_template_parms + && got_scope != current_class_type && uses_template_parms (got_scope) && val && TREE_CODE (val) == TYPE_DECL && ! DECL_ARTIFICIAL (val)) @@ -5507,7 +5494,7 @@ init_decl_processing () flag_inline_functions = 0; } - if (! SUPPORTS_WEAK) + if (! supports_one_only ()) flag_weak = 0; /* Create the global bindings for __FUNCTION__ and __PRETTY_FUNCTION__. */ @@ -6015,7 +6002,8 @@ start_decl_1 (decl) && TREE_CODE (decl) != TEMPLATE_DECL && IS_AGGR_TYPE (type) && ! DECL_EXTERNAL (decl)) { - if (TYPE_SIZE (complete_type (type)) == NULL_TREE) + if ((! current_template_parms || ! uses_template_parms (type)) + && TYPE_SIZE (complete_type (type)) == NULL_TREE) { cp_error ("aggregate `%#D' has incomplete type and cannot be initialized", decl); @@ -7864,6 +7852,18 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) else { type = TREE_TYPE (id); + if (TREE_CODE (type) == TYPENAME_TYPE + && TYPE_CONTEXT (type) == current_class_type) + { + /* Members of the current class get resolved immediately; + we couldn't catch this one earlier because we hadn't + pushed into the class yet. */ + if (TREE_TYPE (type)) + type = TREE_TYPE (type); + else + type = make_typename_type (TYPE_CONTEXT (type), + TYPE_IDENTIFIER (type)); + } TREE_VALUE (spec) = type; } goto found; @@ -8862,6 +8862,19 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) } ctype = TREE_OPERAND (declarator, 0); + if (TREE_CODE (ctype) == TYPENAME_TYPE + && TYPE_CONTEXT (ctype) == current_class_type) + { + /* Members of the current class get resolved immediately; + we couldn't catch this one earlier because we hadn't + pushed into the class yet. */ + if (TREE_TYPE (ctype)) + ctype = TREE_TYPE (ctype); + else + ctype = make_typename_type (TYPE_CONTEXT (ctype), + TYPE_IDENTIFIER (ctype)); + } + if (sname == NULL_TREE) goto done_scoping; diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 9c5d14c..39a2572 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1356,7 +1356,8 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist) } if (declspecs == NULL_TREE - && TREE_CODE (declarator) == SCOPE_REF) + && TREE_CODE (declarator) == SCOPE_REF + && TREE_CODE (TREE_OPERAND (declarator, 1)) == IDENTIFIER_NODE) { /* Access declaration */ if (! IS_AGGR_TYPE_CODE (TREE_CODE (TREE_OPERAND (declarator, 0)))) @@ -2296,18 +2297,10 @@ void comdat_linkage (decl) tree decl; { - TREE_PUBLIC (decl) = 0; - -#ifdef MAKE_DECL_ONE_ONLY - MAKE_DECL_ONE_ONLY (decl); - TREE_PUBLIC (decl) = 1; -#endif - if (flag_weak) - { - DECL_WEAK (decl) = 1; - TREE_PUBLIC (decl) = 1; - } + make_decl_one_only (decl); + else + TREE_PUBLIC (decl) = 0; } /* Set TREE_PUBLIC and/or DECL_EXTERN on the vtable DECL, @@ -2424,11 +2417,7 @@ finish_vtable_vardecl (prev, vars) { if (write_virtuals >= 0 && ! DECL_EXTERNAL (vars) - && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) -#ifdef DECL_ONE_ONLY - && ! DECL_ONE_ONLY (vars) -#endif - ) + && ((TREE_PUBLIC (vars) && ! DECL_WEAK (vars) && ! DECL_ONE_ONLY (vars)) || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (vars)) || (hack_decl_function_context (vars) && TREE_USED (vars))) && ! TREE_ASM_WRITTEN (vars)) @@ -2594,11 +2583,8 @@ import_export_decl (decl) { /* Statically initialized vars are weak or comdat, if supported. */ -#ifdef MAKE_DECL_ONE_ONLY - MAKE_DECL_ONE_ONLY (decl); -#endif if (flag_weak) - DECL_WEAK (decl) = 1; + make_decl_one_only (decl); /* else leave vars public so multiple defs will break. */ } } @@ -2851,9 +2837,7 @@ finish_file () && ! DECL_EXTERNAL (decl)) { int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl) -#ifdef DECL_ONE_ONLY || DECL_ONE_ONLY (decl) -#endif || DECL_WEAK (decl))); temp = build_cleanup (decl); @@ -2932,9 +2916,7 @@ finish_file () if (TREE_CODE (decl) == VAR_DECL) { int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl) -#ifdef DECL_ONE_ONLY || DECL_ONE_ONLY (decl) -#endif || DECL_WEAK (decl))); /* Set these global variables so that GDB at least puts @@ -3085,10 +3067,7 @@ finish_file () else if (DECL_INITIAL (decl) == 0) p = &TREE_CHAIN (*p); else if ((TREE_PUBLIC (decl) && ! DECL_WEAK (decl) -#ifdef DECL_ONE_ONLY - && ! DECL_ONE_ONLY (decl) -#endif - ) + && ! DECL_ONE_ONLY (decl)) || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) || flag_keep_inline_functions) { diff --git a/gcc/cp/method.c b/gcc/cp/method.c index cf88ccb..c7c63d7 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1705,11 +1705,11 @@ make_thunk (function, delta) TREE_READONLY (thunk) = TYPE_READONLY (TREE_TYPE (vtable_entry_type)); TREE_THIS_VOLATILE (thunk) = TYPE_VOLATILE (TREE_TYPE (vtable_entry_type)); make_function_rtl (thunk); + comdat_linkage (thunk); TREE_SET_CODE (thunk, THUNK_DECL); DECL_INITIAL (thunk) = function; THUNK_DELTA (thunk) = delta; DECL_EXTERNAL (thunk) = 1; - comdat_linkage (thunk); /* So that finish_file can write out any thunks that need to be: */ pushdecl_top_level (thunk); } diff --git a/gcc/cp/mpw-make.sed b/gcc/cp/mpw-make.sed index e821e9b..120b5a1 100644 --- a/gcc/cp/mpw-make.sed +++ b/gcc/cp/mpw-make.sed @@ -43,11 +43,13 @@ LIBDEPS = \ /^SUBDIR_MALLOC/s/`.*`// # Point includes at parent directly correctly. -/^INCLUDES = .*$/s/:\./::/g -/^INCLUDES = .*$/s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g +/^INCLUDES = /s/:\./::/g +/^INCLUDES = /s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g +/^INCLUDES = /s,"{srcdir}"/\.\.,"{topsrcdir}"gcc:,g +/^INCLUDES = /s,"{srcdir}":config,"{topsrcdir}"gcc:config:,g # Add the special MPW include dirs. -/^INCLUDES = .*$/s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/ +/^INCLUDES = /s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/ # A nasty hack to reduce confusion. /true/s/ ; @true$// @@ -101,7 +103,7 @@ LIBDEPS = \ # Fix the compile line for the generated parser. /{CC} -c/,/echo {PARSE_C}/c\ - {CC} {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\ + {CC} @DASH_C_FLAG@ {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\ # Change all Rez commands to use mac-gcc.r. /{REZ}/s/"{s}"[-a-zA-Z{}]*\.r/"{topsrcdir}"gcc:mac-gcc.r/ |