cppinit.c (BC): New macro.

* cppinit.c (BC): New macro.
	(builtin_array): Add __GXX_WEAK__.
	* cpplib.h (builtin_type): Add BT_WEAK.
	* cppmacro.c (builtin_macro): Handle BT_WEAK.
	* defaults.h (SUPPORTS_ONE_ONLY): Define.
	* varasm.c (SUPPORTS_ONE_ONLY): Do not define.

From-SVN: r39436
This commit is contained in:
Mark Mitchell 2001-02-04 08:29:46 +00:00 committed by Mark Mitchell
parent 52b357ea12
commit 1ca894a0e4
6 changed files with 28 additions and 11 deletions

View File

@ -1,3 +1,12 @@
2001-02-04 Mark Mitchell <mark@codesourcery.com>
* cppinit.c (BC): New macro.
(builtin_array): Add __GXX_WEAK__.
* cpplib.h (builtin_type): Add BT_WEAK.
* cppmacro.c (builtin_macro): Handle BT_WEAK.
* defaults.h (SUPPORTS_ONE_ONLY): Define.
* varasm.c (SUPPORTS_ONE_ONLY): Do not define.
2001-02-03 Jakub Jelinek <jakub@redhat.com>
* cppinit.c (append_include_chain): Honor NO_IMPLICIT_EXTERN_C.
@ -81,7 +90,7 @@ Fri Feb 2 20:03:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(init_spec): Use it.
* testsuite/lib/g++.exp: Include the directory where libgcc
is located to the LD_LIBRARY_PATH list.
* inovke.texi (-shared-libgcc): Document the cases in which
* invoke.texi (-shared-libgcc): Document the cases in which
GCC defaults to using the shared libgcc.
2001-02-02 Alexandre Oliva <aoliva@redhat.com>

View File

@ -643,6 +643,7 @@ struct builtin
#define OPERATOR 0x10
#define B(n, t) { U n, 0, t, 0, BUILTIN, sizeof n - 1 }
#define BC(n, t) { U n, 0, t, 0, BUILTIN | CPLUS, sizeof n - 1 }
#define C(n, v) { U n, v, 0, 0, 0, sizeof n - 1 }
#define X(n, f) { U n, 0, 0, 0, f, sizeof n - 1 }
#define O(n, c, f) { U n, 0, 0, c, OPERATOR | f, sizeof n - 1 }
@ -655,6 +656,7 @@ static const struct builtin builtin_array[] =
B("__LINE__", BT_SPECLINE),
B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
B("__STDC__", BT_STDC),
BC("__GXX_WEAK__", BT_WEAK),
X("__VERSION__", VERS),
X("__USER_LABEL_PREFIX__", ULP),

View File

@ -462,7 +462,9 @@ enum builtin_type
BT_BASE_FILE, /* `__BASE_FILE__' */
BT_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */
BT_TIME, /* `__TIME__' */
BT_STDC /* `__STDC__' */
BT_STDC, /* `__STDC__' */
BT_WEAK /* Whether or not G++ supports weak
symbols. */
};
/* There is a slot in the hashnode for use by front ends when integrated

View File

@ -216,6 +216,10 @@ builtin_macro (pfile, token)
*token = node->value.builtin == BT_DATE ? pfile->date: pfile->time;
break;
case BT_WEAK:
make_number_token (pfile, token, SUPPORTS_ONE_ONLY);
break;
default:
cpp_ice (pfile, "invalid builtin macro \"%s\"", node->name);
break;

View File

@ -149,6 +149,15 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
#endif
#endif
/* This determines whether or not we support link-once semantics. */
#ifndef SUPPORTS_ONE_ONLY
#ifdef MAKE_DECL_ONE_ONLY
#define SUPPORTS_ONE_ONLY 1
#else
#define SUPPORTS_ONE_ONLY 0
#endif
#endif
/* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
provide a weak attribute. Else define it to nothing.

View File

@ -4828,15 +4828,6 @@ assemble_alias (decl, target)
#endif
}
/* This determines whether or not we support link-once semantics. */
#ifndef SUPPORTS_ONE_ONLY
#ifdef MAKE_DECL_ONE_ONLY
#define SUPPORTS_ONE_ONLY 1
#else
#define SUPPORTS_ONE_ONLY 0
#endif
#endif
/* Returns 1 if the target configuration supports defining public symbols
so that one of them will be chosen at link time instead of generating a
multiply-defined symbol error, whether through the use of weak symbols or