This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ObjC fixes for --enable-mapped-location


Zack Weinberg wrote:

This patch makes it possible to bootstrap GCC with
--enable-mapped-location --enable-languages=c,c++,objc.

I did a quick-and-dirty (untested) obj patch too. The only interesting difference is where you did:

@@ -2305,15 +2309,12 @@ build_selector_translation_table (void)
}
}
if (!found)
- {
- /* Adjust line number for warning message. */
- int save_lineno = input_line;
- if (flag_next_runtime && TREE_PURPOSE (chain))
- input_line = DECL_SOURCE_LINE (TREE_PURPOSE (chain));
- warning ("creating selector for non existant method %s",
- IDENTIFIER_POINTER (TREE_VALUE (chain)));
- input_line = save_lineno;
- }
+ /* ??? if (flag_next_runtime && DECL_P (TREE_PURPOSE (chain)))
+ diagnostic
+ else
+ same diagnostic but without %J */
+ warning ("%Jcreating selector for nonexistent method %qE",
+ TREE_PURPOSE (chain), TREE_VALUE (chain));
}
expr = build_selector (TREE_VALUE (chain));

I did:


@@ -2307,12 +2309,12 @@ build_selector_translation_table (void)
         if (!found)
           {
             /* Adjust line number for warning message.  */
-            int save_lineno = input_line;
+            location_t save_location = input_location;
             if (flag_next_runtime && TREE_PURPOSE (chain))
-              input_line = DECL_SOURCE_LINE (TREE_PURPOSE (chain));
+              input_location = DECL_SOURCE_LOCATION (TREE_PURPOSE (chain));
             warning ("creating selector for non existant method %s",
                      IDENTIFIER_POINTER (TREE_VALUE (chain)));
-            input_line = save_lineno;
+            input_location = save_location;
           }
       }

Using %J is probably better, though I don't know the issues that
made you put in the ???.  Since Zem is happy with your version, I'm too.

[I'm back home, building the compiler so I can do
tests and measurements of my big Java patch.]
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]