lex.c (parse_strconst_pragma): Return error_mark_node instead of "(tree)-1" to indica...
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 13 Feb 2006 22:00:35 +0000 (22:00 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 13 Feb 2006 22:00:35 +0000 (22:00 +0000)
* lex.c (parse_strconst_pragma): Return error_mark_node instead of
"(tree)-1" to indicate failure.  Simplify.
(handle_pragma_interface): Test for error_mark_node instead of
"(tree)-1".
(handle_pragma_implementation): Likewise.

From-SVN: r110932

gcc/cp/ChangeLog
gcc/cp/lex.c

index fc53be07e7cd813d0413e0dd1c91caa1880969af..925c33204cf7a7253e748884f3f028581abe6fa7 100644 (file)
@@ -1,3 +1,11 @@
+2006-02-13  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       * lex.c (parse_strconst_pragma): Return error_mark_node instead of
+       "(tree)-1" to indicate failure.  Simplify.
+       (handle_pragma_interface): Test for error_mark_node instead of
+       "(tree)-1".
+       (handle_pragma_implementation): Likewise.
+
 2006-02-13  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/26151
index b3d8b608f75867463f3d7b03b15b2ee2a9bade29..5dbaf8b0464f47503b4df6904fe425570f03806a 100644 (file)
@@ -460,20 +460,19 @@ parse_strconst_pragma (const char* name, int opt)
   tree result, x;
   enum cpp_ttype t;
 
-  t = pragma_lex (&x);
+  t = pragma_lex (&result);
   if (t == CPP_STRING)
     {
-      result = x;
       if (pragma_lex (&x) != CPP_EOF)
        warning (0, "junk at end of #pragma %s", name);
       return result;
     }
 
   if (t == CPP_EOF && opt)
-    return 0;
+    return NULL_TREE;
 
   error ("invalid #pragma %s", name);
-  return (tree)-1;
+  return error_mark_node;
 }
 
 static void
@@ -497,7 +496,7 @@ handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED )
   struct c_fileinfo *finfo;
   const char *filename;
 
-  if (fname == (tree)-1)
+  if (fname == error_mark_node)
     return;
   else if (fname == 0)
     filename = lbasename (input_filename);
@@ -537,7 +536,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED )
   const char *filename;
   struct impl_files *ifiles = impl_file_chain;
 
-  if (fname == (tree)-1)
+  if (fname == error_mark_node)
     return;
 
   if (fname == 0)