]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cppinit.c (BC): New macro.
authorMark Mitchell <mark@codesourcery.com>
Sun, 4 Feb 2001 08:29:46 +0000 (08:29 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 4 Feb 2001 08:29:46 +0000 (08:29 +0000)
* 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

gcc/ChangeLog
gcc/cppinit.c
gcc/cpplib.h
gcc/cppmacro.c
gcc/defaults.h
gcc/varasm.c

index 678c5d6e237cc0d052caa3d5efe54be386e272fa..4d1fadea6120c51cc212e8f214b2545c5d3038ca 100644 (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>
index 8319ad987fb5c3fdfc626ea92301002036b252cc..845d35b7fd1dbf0d299f4140f57966bed4afb93d 100644 (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),
index 9d0b8e253fb4c940cc3ee7933315122650b1ea05..eec4f1eb4353b49dde2f0ad9cb716954cde10ce4 100644 (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
index afe60dce87714cf3b16d38d24eaa3fe8a2dad301..8e051a9c5b07223f8fd5ba9c8cf43286155a0708 100644 (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;
index b0f3ce9fa6df097b38a0b8a8bda18c3485ca5769..c1c938b5c0c0404fb4ade2e7cbe70025d4199def 100644 (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. 
 
index cae65cc413e0ccdb4bdbd536192732518e6aa1c6..047065777d77eae687c3567dc730f6990b753c76 100644 (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