]> gcc.gnu.org Git - gcc.git/commitdiff
c-tree.h (skip_evaluation): Move declaration...
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 15 Aug 2002 21:16:23 +0000 (21:16 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 15 Aug 2002 21:16:23 +0000 (21:16 +0000)
* c-tree.h (skip_evaluation): Move declaration...
* c-common.h: ... here.
* c-typeck.c (build_external_ref): Don't assemble_external nor
mark a tree as used if skip_evaluation is set.
* c-parse.in (typeof): New non-terminal to set skip_evaluation
around TYPEOF.
(typespec_nonreserved_nonattr): Use it.

From-SVN: r56358

gcc/ChangeLog
gcc/c-common.h
gcc/c-parse.in
gcc/c-tree.h
gcc/c-typeck.c

index 7d618c39a5fda16a689be5ed155d2a680bc46e2e..015b2406aafcd0f7c71c42f9aeab8bdc4b13a4c7 100644 (file)
@@ -1,3 +1,13 @@
+2002-08-15  Alexandre Oliva  <aoliva@redhat.com>
+
+       * c-tree.h (skip_evaluation): Move declaration...
+       * c-common.h: ... here.
+       * c-typeck.c (build_external_ref): Don't assemble_external nor
+       mark a tree as used if skip_evaluation is set.
+       * c-parse.in (typeof): New non-terminal to set skip_evaluation
+       around TYPEOF.
+       (typespec_nonreserved_nonattr): Use it.
+
 2002-08-15  Douglas B Rupp  <rupp@gnat.com>
 
        * dbxout.c (dbx_debug_hooks): Update end_prologue, end_epilogue.
index 038b23982e359b53b418bff93828f37f20f7985d..6968d70dac9f326ca820183722ad0658db091da4 100644 (file)
@@ -790,6 +790,11 @@ extern int warn_deprecated;
 
 extern int max_tinst_depth;
 
+/* Nonzero means the expression being parsed will never be evaluated.
+   This is a count, since unevaluated expressions can nest.  */
+
+extern int skip_evaluation;
+
 /* C types are partitioned into three subsets: object, function, and
    incomplete types.  */
 #define C_TYPE_OBJECT_P(type) \
index 11e0e442cc2ffe7ab40818a283e05195aaa37d9c..eab176a62f7f47ce92eba39df454d83a2f3caa7f 100644 (file)
@@ -562,6 +562,10 @@ alignof:
        ALIGNOF { skip_evaluation++; }
        ;
 
+typeof:
+       TYPEOF { skip_evaluation++; }
+       ;
+
 cast_expr:
        unary_expr
        | '(' typename ')' cast_expr  %prec UNARY
@@ -1394,10 +1398,10 @@ ifobjc
         | non_empty_protocolrefs
                 { $$ = get_object_reference ($1); }
 end ifobjc
-       | TYPEOF '(' expr ')'
-               { $$ = TREE_TYPE ($3); }
-       | TYPEOF '(' typename ')'
-               { $$ = groktypename ($3); }
+       | typeof '(' expr ')'
+               { skip_evaluation--; $$ = TREE_TYPE ($3); }
+       | typeof '(' typename ')'
+               { skip_evaluation--; $$ = groktypename ($3); }
        ;
 
 /* typespec_nonreserved_attr does not exist.  */
index c92f1f13565df427ba7f22f03b87ad48473ee87a..0d6829fc6e9005217246fb6f5c00c9e3754f8182 100644 (file)
@@ -311,11 +311,6 @@ extern int current_function_returns_null;
 
 extern int current_function_returns_abnormally;
 
-/* Nonzero means the expression being parsed will never be evaluated.
-   This is a count, since unevaluated expressions can nest.  */
-
-extern int skip_evaluation;
-
 /* Nonzero means we are reading code that came from a system header file.  */
 
 extern int system_header_p;
index dedb72f59ffdb14b5f7a390a0a3f7e564b1ae25b..bfc44848ad76e35bde413de2b38c4051d948a2d6 100644 (file)
@@ -1441,7 +1441,8 @@ build_external_ref (id, fun)
   if (TREE_TYPE (ref) == error_mark_node)
     return error_mark_node;
 
-  assemble_external (ref);
+  if (!skip_evaluation)
+    assemble_external (ref);
   TREE_USED (ref) = 1;
 
   if (TREE_CODE (ref) == CONST_DECL)
This page took 1.512254 seconds and 5 git commands to generate.