Author: void
Date: Mon Oct  1 15:09:53 2007
New Revision: 42497

URL: http://llvm.org/viewvc/llvm-project?rev=42497&view=rev
Log:
GCC uses "i32 0" for null pointers. LLVM uses pointer types.

Modified:
    llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=42497&r1=42496&r2=42497&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Oct  1 15:09:53 2007
@@ -2576,7 +2576,8 @@
 
   /* struct objc_method_list   *optional_instance_methods; */
   if (!optional_instance_meth)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_list_ptr, build_unary_op (ADDR_EXPR, 
@@ -2586,7 +2587,8 @@
 
   /* struct objc_method_list   *optional_class_methods; */
   if (!optional_class_meth)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_list_ptr, build_unary_op (ADDR_EXPR, 
@@ -2596,7 +2598,8 @@
 
   /* struct objc_prop_list     *instance_properties; */
   if (!instance_prop)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_prop_list_ptr, build_unary_op (ADDR_EXPR, 
@@ -2677,7 +2680,8 @@
 
   /* struct _prop_list_t *properties; */
   if (!property_list)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_prop_list_ptr,
@@ -4871,7 +4875,8 @@
   /* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */
 
   if (flag_next_runtime || ! sel_ref_chain)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     initlist
       = tree_cons (NULL_TREE,
@@ -9134,7 +9139,8 @@
                                                 (objc_protocol_template)),
                             build_unary_op (ADDR_EXPR, refs_decl, 0));
       else
-       refs_expr = build_int_cst (NULL_TREE, 0);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       refs_expr = null_pointer_node;
 
 
       /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */
@@ -9204,7 +9210,8 @@
   if (newabi)
     {
       /* 'isa' is NULL in the new ObjC abi */
-      expr = build_int_cst (NULL_TREE, 0);
+      /* APPLE LOCAL LLVM - NUL pointer */
+      expr = null_pointer_node;
     }
   /* APPLE LOCAL end radar 4533974 - ObjC newprotocol - radar 4695109 */
   /* APPLE LOCAL begin radar 4585769 - Objective-C 1.0 extensions */
@@ -9212,7 +9219,8 @@
   else
     {
       if (!objc_protocol_or_opt_ins_meth)
-       expr = build_int_cst (NULL_TREE, 0);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       expr = null_pointer_node;
       else
        expr = convert (build_pointer_type (objc_protocol_extension_template),
                        build_unary_op (ADDR_EXPR, 
objc_protocol_or_opt_ins_meth, 0));  
@@ -9226,7 +9234,8 @@
   initlist = tree_cons (NULL_TREE, protocol_list, initlist);
 
   if (!instance_methods)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_proto_list_ptr,
@@ -9235,7 +9244,8 @@
     }
 
   if (!class_methods)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_proto_list_ptr,
@@ -9248,7 +9258,8 @@
     {
       /* APPLE LOCAL begin radar 4695109 */
       if (!objc_protocol_or_opt_ins_meth)
-       initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), 
initlist);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
       else
        {
          expr = convert (objc_method_proto_list_ptr,
@@ -9256,7 +9267,8 @@
          initlist = tree_cons (NULL_TREE, expr, initlist);
        }
       if (!opt_cls_meth)
-       initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), 
initlist);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
       else
        {
          expr = convert (objc_method_proto_list_ptr,
@@ -9265,7 +9277,8 @@
        }
       /* APPLE LOCAL end radar 4695109 */
       if (!property_list)
-       initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), 
initlist);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
       else
        {
          expr = convert (objc_prop_list_ptr,
@@ -10291,7 +10304,8 @@
                        ivar);
     else
       /* Unnamed bit-field ivar (yuck).  */
-      ivar = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), ivar);
+      /* APPLE LOCAL LLVM - NUL pointer */
+      ivar = tree_cons (NULL_TREE, null_pointer_node, ivar);
 
     /* Set type */
     encode_field_decl (field_decl,
@@ -10348,7 +10362,8 @@
                          ivar);
       else
        /* Unnamed bit-field ivar (yuck).  */
-       ivar = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), ivar);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       ivar = tree_cons (NULL_TREE, null_pointer_node, ivar);
 
       /* Set type.  */
       encode_field_decl (field_decl,
@@ -11042,7 +11057,8 @@
   initlist = tree_cons (NULL_TREE, class_name, initlist);
 
   if (!instance_methods)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_list_ptr,
@@ -11050,7 +11066,8 @@
       initlist = tree_cons (NULL_TREE, expr, initlist);
     }
   if (!class_methods)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_list_ptr,
@@ -11060,7 +11077,8 @@
 
   /* protocol_list = */
   if (!protocol_list)
-     initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       /* APPLE LOCAL begin radar 4533974 - ObjC new protocol */
@@ -11082,7 +11100,8 @@
   /* APPLE LOCAL begin C* property metadata (Radar 4498373) */
   /* struct _objc_property_list *instance_properties; */
   if (!property_list)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_prop_list_ptr,
@@ -11149,7 +11168,8 @@
 
   /* objc_ivar_list = */
   if (!ivar_list)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_ivar_list_ptr,
@@ -11159,7 +11179,8 @@
 
   /* objc_method_list = */
   if (!dispatch_table)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_list_ptr,
@@ -11169,22 +11190,27 @@
 
   if (flag_next_runtime)
     /* method_cache = */
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       /* dtable = */
-      initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+      /* APPLE LOCAL LLVM - NUL pointer */
+      initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
 
       /* subclass_list = */
-      initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+      /* APPLE LOCAL LLVM - NUL pointer */
+      initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
 
       /* sibling_class = */
-      initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+      /* APPLE LOCAL LLVM - NUL pointer */
+      initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
     }
 
   /* protocol_list = */
   if (! protocol_list)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (build_pointer_type
@@ -11199,18 +11225,21 @@
     {
       /* const char *ivar_layout; */
       if (IS_CLS_META (status)) /* Meta Class ? */
-       initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), 
initlist);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
       else
        {
          tree ivar_layout = objc_build_ivar_layout (true);
          if (!ivar_layout)
-           initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), 
initlist);
+           /* APPLE LOCAL LLVM - NUL pointer */
+           initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
          else
            initlist = tree_cons (NULL_TREE, ivar_layout, initlist);
        }
       /* struct _objc_class_ext *ext; */
       if (!objc_class_ext)
-        initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), 
initlist);
+       /* APPLE LOCAL LLVM - NUL pointer */
+        initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
       else
        {
          expr = convert (build_pointer_type (objc_class_ext_template), 
@@ -11220,7 +11249,8 @@
     }
   else
     /* gc_object_type = NULL */
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   /* APPLE LOCAL end radar 4585769 - Objective-C 1.0 extensions */
 
   return objc_build_constructor (type, nreverse (initlist));
@@ -11382,13 +11412,15 @@
   if (cache)
     initlist = tree_cons (NULL_TREE, cache, initlist);
   else
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
 
   /* vtable */
   if (vtable)
     initlist = tree_cons (NULL_TREE, vtable, initlist);
   else
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
 
   /* ro */
   initlist = tree_cons (NULL_TREE, ro, initlist);
@@ -11432,7 +11464,8 @@
   /* APPLE LOCAL begin radar 4695101 */
   /* ivarLayout */
   if (!ivarLayout)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     initlist = tree_cons (NULL_TREE, ivarLayout, initlist);
   /* APPLE LOCAL end radar 4695101 */
@@ -11442,7 +11475,8 @@
 
   /* baseMethods */
   if (!baseMethods)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_method_list_ptr,
@@ -11452,31 +11486,34 @@
 
   /* baseProtocols */
   if (!baseProtocols)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       tree protocol_list_t_p = build_pointer_type (
                               xref_tag (RECORD_TYPE, 
                                         get_identifier 
(UTAG_V2_PROTOCOL_LIST)));
       expr = convert (protocol_list_t_p,
-                      build_unary_op (ADDR_EXPR, baseProtocols, 0));
+                     build_unary_op (ADDR_EXPR, baseProtocols, 0));
       initlist = tree_cons (NULL_TREE, expr, initlist);
     }
 
   /* ivars */
   if (!ivars)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_v2_ivar_list_ptr,
-                      build_unary_op (ADDR_EXPR, ivars, 0));
+                     build_unary_op (ADDR_EXPR, ivars, 0));
       initlist = tree_cons (NULL_TREE, expr, initlist);
     }
 
   /* APPLE LOCAL begin radar 4695101 */
   /* weakIvarLayout */
   if (!weakIvarLayout)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     initlist = tree_cons (NULL_TREE, weakIvarLayout, initlist);
   /* APPLE LOCAL end radar 4695101 */
@@ -11484,11 +11521,12 @@
   /* APPLE LOCAL begin C* property metadata (Radar 4498373) */
   /* property list */
   if (!property_list)
-    initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    initlist = tree_cons (NULL_TREE, null_pointer_node, initlist);
   else
     {
       expr = convert (objc_prop_list_ptr,
-                      build_unary_op (ADDR_EXPR, property_list, 0));
+                     build_unary_op (ADDR_EXPR, property_list, 0));
       initlist = tree_cons (NULL_TREE, expr, initlist);
     }
   /* APPLE LOCAL end C* property metadata (Radar 4498373) */
@@ -11735,7 +11773,8 @@
       /* root class.  */
       root_expr = build_unary_op (ADDR_EXPR, metaclass_decl, 0);
       metaclass_superclass_expr = build_unary_op (ADDR_EXPR, class_decl, 0);
-      class_superclass_expr = build_int_cst (NULL_TREE, 0);
+      /* APPLE LOCAL LLVM - NUL pointer */
+      class_superclass_expr = null_pointer_node;
       flags |= 0x2; /* CLS_ROOT: it is also a root meta class */
     }
 
@@ -11927,7 +11966,8 @@
       super_expr = build_c_cast (cast_type, super_expr); /* cast! */
     }
   else
-    super_expr = build_int_cst (NULL_TREE, 0);
+    /* APPLE LOCAL LLVM - NUL pointer */
+    super_expr = null_pointer_node;
 
   root_expr = add_objc_string (my_root_id, class_names);
   root_expr = build_c_cast (cast_type, root_expr); /* cast! */
@@ -13190,7 +13230,8 @@
        refs_expr = convert (build_pointer_type (objc_v2_protocol_template),
                             build_unary_op (ADDR_EXPR, refs_decl, 0));
       else
-       refs_expr = build_int_cst (NULL_TREE, 0);
+       /* APPLE LOCAL LLVM - NUL pointer */
+       refs_expr = null_pointer_node;
 
       /* APPLE LOCAL begin radar 4695101 */
       /* Build table of list of properties for this protocol. */


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to