OSDN Git Service

[gcc/ChangeLog]
[pf3gnuchains/gcc-fork.git] / gcc / c-objc-common.c
index e9a4a09..d011ef4 100644 (file)
@@ -1,5 +1,5 @@
 /* Some code common to C and ObjC front ends.
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -61,7 +61,8 @@ c_disregard_inline_limits (tree fn)
   if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
     return 1;
 
-  return DECL_DECLARED_INLINE_P (fn) && DECL_EXTERNAL (fn);
+  return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
+         && DECL_EXTERNAL (fn));
 }
 
 int
@@ -79,7 +80,7 @@ c_cannot_inline_tree_fn (tree *fnp)
     {
       if (do_warning)
        warning ("%Jfunction '%F' can never be inlined because it "
-                "is supressed using -fno-inline", fn, fn);
+                "is suppressed using -fno-inline", fn, fn);
       goto cannot_inline;
     }
 
@@ -264,17 +265,6 @@ c_objc_common_finish_file (void)
 
       finish_cdtor (body);
     }
-
-  {
-    int flags;
-    FILE *stream = dump_begin (TDI_all, &flags);
-
-    if (stream)
-      {
-       dump_node (getdecls (), flags & ~TDF_SLIM, stream);
-       dump_end (TDI_all, stream);
-      }
-  }
 }
 
 /* Called during diagnostic message formatting process to print a
@@ -331,3 +321,32 @@ c_tree_printer (pretty_printer *pp, text_info *text)
   pp_string (pp, n);
   return true;
 }
+
+tree
+c_objc_common_truthvalue_conversion (tree expr)
+{
+ retry:
+  switch (TREE_CODE (TREE_TYPE (expr)))
+    {
+    case ARRAY_TYPE:
+      expr = default_conversion (expr);
+      if (TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE)
+       goto retry;
+
+      error ("used array that cannot be converted to pointer where scalar is required");
+      return error_mark_node;
+
+    case RECORD_TYPE:
+      error ("used struct type value where scalar is required");
+      return error_mark_node;
+
+    case UNION_TYPE:
+      error ("used union type value where scalar is required");
+      return error_mark_node;
+    default:
+      break;
+    }
+
+  return c_common_truthvalue_conversion (expr);
+}
+