aboutsummaryrefslogtreecommitdiff
path: root/gcc/gengtype.c
diff options
context:
space:
mode:
authorZiemowit Laski <zlaski@apple.com>2004-08-18 01:58:13 +0000
committerZiemowit Laski <zlaski@gcc.gnu.org>2004-08-18 01:58:13 +0000
commitad8c162bc1f1ea2113598c0009fdba2c1c0b361d (patch)
treee96c191583dd94357f6928dca746faaf24ca6aa5 /gcc/gengtype.c
parent3bc268e64b4167a3566c8b53decda0b06668f6fe (diff)
downloadgcc-ad8c162bc1f1ea2113598c0009fdba2c1c0b361d.zip
gcc-ad8c162bc1f1ea2113598c0009fdba2c1c0b361d.tar.gz
gcc-ad8c162bc1f1ea2113598c0009fdba2c1c0b361d.tar.bz2
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
Diffstat (limited to 'gcc/gengtype.c')
-rw-r--r--gcc/gengtype.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index a1c23d2..6cb89f0 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -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;