gcc.c (default_compilers): Add info about ".mm", ".M" and ".mii" Objective-C++ extensions.

[gcc/ChangeLog]
2004-08-18  Ziemowit Laski  <zlaski@apple.com>

        * gcc.c (default_compilers): Add info about ".mm", ".M" and ".mii"
        Objective-C++ extensions.
        * gengtype.c (get_file_basename): Match entire subdirectory name
        ('cp', 'objc', 'objcp') rather than just its suffix.
        (get_base_file_bitmap): Allow for files to belong to more than one
        language.
        (get_output_file_with_visibility): Treat objc/objc-act.h as a header
        used by more than one front-end.

From-SVN: r86167
This commit is contained in:
Ziemowit Laski 2004-08-18 01:58:13 +00:00 committed by Ziemowit Laski
parent 3bc268e64b
commit ad8c162bc1
3 changed files with 28 additions and 6 deletions

View File

@ -1,3 +1,14 @@
2004-08-18 Ziemowit Laski <zlaski@apple.com>
* gcc.c (default_compilers): Add info about ".mm", ".M" and ".mii"
Objective-C++ extensions.
* gengtype.c (get_file_basename): Match entire subdirectory name
('cp', 'objc', 'objcp') rather than just its suffix.
(get_base_file_bitmap): Allow for files to belong to more than one
language.
(get_output_file_with_visibility): Treat objc/objc-act.h as a header
used by more than one front-end.
2004-08-18 Richard Earnshaw <rearnsha@arm.com>
* arm.md (addsi3, subsi3, andsi3, iorsi3, movsi, movhi): Rework to
@ -211,7 +222,7 @@
2004-08-16 Adam Nemet <anemet@lnxw.com>
* Makefile.in (LIBS): Move $(LIBIBERTY) after $(BANSHEELIB).
2004-08-16 Andrew Pinski <apinski@apple.com>
* target-def.h (TARGET_EH_RETURN_FILTER_MODE): Remove

View File

@ -918,6 +918,8 @@ static const struct compiler default_compilers[] =
and be given a more meaningful error than "file not used since
linking is not done". */
{".m", "#Objective-C", 0, 0, 0}, {".mi", "#Objective-C", 0, 0, 0},
{".mm", "#Objective-C++", 0, 0, 0}, {".M", "#Objective-C++", 0, 0, 0},
{".mii", "#Objective-C++", 0, 0, 0},
{".cc", "#C++", 0, 0, 0}, {".cxx", "#C++", 0, 0, 0},
{".cpp", "#C++", 0, 0, 0}, {".cp", "#C++", 0, 0, 0},
{".c++", "#C++", 0, 0, 0}, {".C", "#C++", 0, 0, 0},

View File

@ -1096,7 +1096,7 @@ get_file_basename (const char *f)
s2 = lang_dir_names [i];
l1 = strlen (s1);
l2 = strlen (s2);
if (l1 >= l2 && !memcmp (s1, s2, l2))
if (l1 >= l2 && IS_DIR_SEPARATOR (s1[-1]) && !memcmp (s1, s2, l2))
{
basename -= l2 + 1;
if ((basename - f - 1) != srcdir_len)
@ -1125,6 +1125,10 @@ get_base_file_bitmap (const char *input_file)
unsigned k;
unsigned bitmap;
/* If the file resides in a language subdirectory (e.g., 'cp'), assume that
it belongs to the corresponding language. The file may belong to other
languages as well (which is checked for below). */
if (slashpos)
{
size_t i;
@ -1134,10 +1138,7 @@ get_base_file_bitmap (const char *input_file)
{
/* It's in a language directory, set that language. */
bitmap = 1 << i;
return bitmap;
}
abort (); /* Should have found the language. */
}
/* If it's in any config-lang.in, then set for the languages
@ -1200,11 +1201,19 @@ get_output_file_with_visibility (const char *input_file)
memcpy (s, ".h", sizeof (".h"));
for_name = basename;
}
/* Some headers get used by more than one front-end; hence, it
would be inappropriate to spew them out to a single gtype-<lang>.h
(and gengtype doesn't know how to direct spewage into multiple
gtype-<lang>.h headers at this time). Instead, we pair up these
headers with source files (and their special purpose gt-*.h headers). */
else if (strcmp (basename, "c-common.h") == 0)
output_name = "gt-c-common.h", for_name = "c-common.c";
else if (strcmp (basename, "c-tree.h") == 0)
output_name = "gt-c-decl.h", for_name = "c-decl.c";
else
else if (strncmp (basename, "objc", 4) == 0 && IS_DIR_SEPARATOR (basename[4])
&& strcmp (basename + 5, "objc-act.h") == 0)
output_name = "gt-objc-objc-act.h", for_name = "objc/objc-act.c";
else
{
size_t i;