summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2010-05-28 23:13:18 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2010-05-28 23:13:18 +0000
commitbffad7f1cf127cbc4b103db2f30317e9f59422fd (patch)
tree10c0cab781166ed9521df083f46d8b46e2cb8deb
parentd685a689926729886f15c873b3a97b91464e063e (diff)
downloadgcc-bffad7f1cf127cbc4b103db2f30317e9f59422fd.tar.gz
c-common.h: Add FIXME for awkward split of c_register_addr_space.
gcc/ChangeLog: * c-common.h: Add FIXME for awkward split of c_register_addr_space. * c-common.c (c_register_addr_space): Remove here. * c-decl.c (c_register_addr_space): Re-add here. cp/ChangeLog: * tree.c (c_register_addr_space): Add stub. From-SVN: r160006
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-common.c20
-rw-r--r--gcc/c-common.h3
-rw-r--r--gcc/c-decl.c19
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/tree.c10
6 files changed, 42 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a8d7edc720d..be57481b0c3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
+
+ * c-common.h: Add FIXME for awkward split of c_register_addr_space.
+ * c-common.c (c_register_addr_space): Remove here.
+ * c-decl.c (c_register_addr_space): Re-add here.
+
2010-05-28 Mike Stump <mikestump@comcast.net>
* config/darwin-c.c: Remove c-tree.h include.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 77026faf64b..328634728e8 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -853,26 +853,6 @@ const struct attribute_spec c_common_format_attribute_table[] =
{ NULL, 0, 0, false, false, false, NULL }
};
-
-/* Register reserved keyword WORD as qualifier for address space AS. */
-
-void
-c_register_addr_space (const char *word, addr_space_t as)
-{
- int rid = RID_FIRST_ADDR_SPACE + as;
- tree id;
-
- /* Address space qualifiers are only supported
- in C with GNU extensions enabled. */
- if (c_dialect_cxx () || c_dialect_objc () || flag_no_asm)
- return;
-
- id = get_identifier (word);
- C_SET_RID_CODE (id, rid);
- C_IS_RESERVED_WORD (id) = 1;
- ridpointers [rid] = id;
-}
-
/* Return identifier for address space AS. */
const char *
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 039edbee974..3056cae3aa1 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -799,7 +799,10 @@ extern const struct attribute_spec c_common_format_attribute_table[];
extern tree (*make_fname_decl) (location_t, tree, int);
+/* In c-decl.c and cp/tree.c. FIXME. */
extern void c_register_addr_space (const char *str, addr_space_t as);
+
+/* In c-common.c. */
extern const char *c_addr_space_name (addr_space_t as);
extern tree identifier_global_value (tree);
extern void record_builtin_type (enum rid, const char *, tree);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index a49694007d2..82632d99345 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -9672,4 +9672,23 @@ c_write_global_declarations (void)
ext_block = NULL;
}
+/* Register reserved keyword WORD as qualifier for address space AS. */
+
+void
+c_register_addr_space (const char *word, addr_space_t as)
+{
+ int rid = RID_FIRST_ADDR_SPACE + as;
+ tree id;
+
+ /* Address space qualifiers are only supported
+ in C with GNU extensions enabled. */
+ if (c_dialect_objc () || flag_no_asm)
+ return;
+
+ id = get_identifier (word);
+ C_SET_RID_CODE (id, rid);
+ C_IS_RESERVED_WORD (id) = 1;
+ ridpointers [rid] = id;
+}
+
#include "gt-c-decl.h"
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7b3445bbf99..d9164d2e4dd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
+
+ * tree.c (c_register_addr_space): Add stub.
+
2010-05-28 Joseph Myers <joseph@codesourcery.com>
* g++spec.c (lang_specific_driver): Use fatal_error instead of
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index d5ccd65a790..9a5ee0fb2d8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3199,6 +3199,16 @@ cp_free_lang_data (tree t)
}
}
+/* Stub for c-common. Please keep in sync with c-decl.c.
+ FIXME: If address space support is target specific, then this
+ should be a C target hook. But currently this is not possible,
+ because this function is called via REGISTER_TARGET_PRAGMAS. */
+void
+c_register_addr_space (const char *word ATTRIBUTE_UNUSED,
+ addr_space_t as ATTRIBUTE_UNUSED)
+{
+}
+
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
/* Complain that some language-specific thing hanging off a tree