aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTristan Gingold <gingold@gcc.gnu.org>2012-03-09 10:13:35 +0000
committerTristan Gingold <gingold@gcc.gnu.org>2012-03-09 10:13:35 +0000
commit575a62352656475e46054570556afa5b2ecd6882 (patch)
treec5b021a53417cd026ba2d1ed98fff04bba18c8f3 /gcc
parent0d7de0e10b5ca459aecadd115cd818e161c3db3f (diff)
downloadgcc-575a62352656475e46054570556afa5b2ecd6882.zip
gcc-575a62352656475e46054570556afa5b2ecd6882.tar.gz
gcc-575a62352656475e46054570556afa5b2ecd6882.tar.bz2
vms-c.c (vms_construct_include_filename): New function.
2012-03-09 Tristan Gingold <gingold@adacore.com> * config/vms/vms-c.c (vms_construct_include_filename): New function. (vms_c_register_includes): Reference it. From-SVN: r185133
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/vms/vms-c.c32
2 files changed, 38 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1bce1c7..3b05846 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-09 Tristan Gingold <gingold@adacore.com>
+
+ * config/vms/vms-c.c (vms_construct_include_filename): New function.
+ (vms_c_register_includes): Reference it.
+
2012-03-09 Andrew Pinski <apinski@cavium.com>
PR middle-end/51988
@@ -7,8 +12,8 @@
value_replacement instead of just the singleton one.
(value_replacement): Change return type to int. Return 0 instead of
false.
- Allow the middle basic block to contain more than just the definings
- tatement.
+ Allow the middle basic block to contain more than just the defining
+ statement.
Handle non empty middle basic blocks.
* Makefile.in (tree-ssa-phiopt.o): Add tree-pretty-print.h.
diff --git a/gcc/config/vms/vms-c.c b/gcc/config/vms/vms-c.c
index 4a2d19c..69b054d 100644
--- a/gcc/config/vms/vms-c.c
+++ b/gcc/config/vms/vms-c.c
@@ -304,6 +304,36 @@ vms_c_register_pragma (void)
c_register_pragma (NULL, "__extern_prefix", vms_pragma_extern_prefix);
}
+/* Canonicalize the filename (remove directory prefix, force the .h extension),
+ and append it to the directory to create the path, but don't
+ turn / into // or // into ///; // may be a namespace escape. */
+
+static char *
+vms_construct_include_filename (const char *fname, cpp_dir *dir)
+{
+ size_t dlen, flen;
+ char *path;
+ const char *fbasename = lbasename (fname);
+ size_t i;
+
+ dlen = dir->len;
+ flen = strlen (fbasename) + 2;
+ path = XNEWVEC (char, dlen + 1 + flen + 1);
+ memcpy (path, dir->name, dlen);
+ if (dlen && !IS_DIR_SEPARATOR (path[dlen - 1]))
+ path[dlen++] = '/';
+ for (i = 0; i < flen; i++)
+ if (fbasename[i] == '.')
+ break;
+ else
+ path[dlen + i] = TOLOWER (fbasename[i]);
+ path[dlen + i + 0] = '.';
+ path[dlen + i + 1] = 'h';
+ path[dlen + i + 2] = 0;
+
+ return path;
+}
+
/* Standard modules list. */
static const char * const vms_std_modules[] = { "rtldef", "starlet_c", NULL };
@@ -341,7 +371,7 @@ vms_c_register_includes (const char *sysroot,
p->next = NULL;
p->name = path;
p->sysp = 1;
- p->construct = 0;
+ p->construct = vms_construct_include_filename;
p->user_supplied_p = 0;
add_cpp_dir_path (p, SYSTEM);
}