summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-21 21:38:21 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-21 21:38:21 +0000
commit820c090b60266f0102253822c3d108e05f135014 (patch)
tree3a09989bc2b7ebdaa2146f5f3b8aa2731fc84b6f
parent63bd35a7652b3d77d4a6e04924c7c365fa89589e (diff)
downloadgcc-820c090b60266f0102253822c3d108e05f135014.tar.gz
PR target/47822
* config/darwin-protos.h (darwin_init_cfstring_builtins): Return a tree so we can get save the type. * config/i386/darwin.h (SUBTARGET_INIT_BUILTINS): Reserve builtin slot for CFString instead of trying to use past the end of the builtins. * config/i386/i386.c (IX86_BUILTIN_CFSTRING): Likewise. * config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_CFSTRING): Likewise. * config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS): Likewise. * config/darwin.c (DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING): Rename to darwin_builtin_cfstring. (darwin_init_cfstring_builtins): Return the built type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170376 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/darwin-protos.h2
-rw-r--r--gcc/config/darwin.c16
-rw-r--r--gcc/config/i386/darwin.h3
-rw-r--r--gcc/config/i386/i386.c3
-rw-r--r--gcc/config/rs6000/darwin.h3
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def3
7 files changed, 34 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 89113ffbfd7..1bb112ff701 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2011-02-21 Mike Stump <mikestump@comcast.net>
+
+ PR target/47822
+ * config/darwin-protos.h (darwin_init_cfstring_builtins): Return a
+ tree so we can get save the type.
+ * config/i386/darwin.h (SUBTARGET_INIT_BUILTINS): Reserve builtin slot
+ for CFString instead of trying to use past the end of the builtins.
+ * config/i386/i386.c (IX86_BUILTIN_CFSTRING): Likewise.
+ * config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_CFSTRING): Likewise.
+ * config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS): Likewise.
+ * config/darwin.c (DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING):
+ Rename to darwin_builtin_cfstring.
+ (darwin_init_cfstring_builtins): Return the built type.
+
2011-02-21 Uros Bizjak <ubizjak@gmail.com>
PR target/47840
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index 00230994ad5..4a9961119c5 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -110,7 +110,7 @@ extern void darwin_asm_output_aligned_decl_common (FILE *, tree, const char *,
extern bool darwin_binds_local_p (const_tree);
extern void darwin_cpp_builtins (struct cpp_reader *);
-extern void darwin_init_cfstring_builtins (unsigned);
+extern tree darwin_init_cfstring_builtins (unsigned);
extern tree darwin_fold_builtin (tree, int, tree *, bool);
extern tree darwin_objc_construct_string (tree);
extern bool darwin_cfstring_p (tree);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 2969f1020e6..5e358b13f09 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -3001,7 +3001,7 @@ static GTY(()) tree pccfstring_type_node = NULL_TREE;
static GTY(()) tree pcint_type_node = NULL_TREE;
static GTY(()) tree pcchar_type_node = NULL_TREE;
-static enum built_in_function DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING;
+static enum built_in_function darwin_builtin_cfstring;
/* Store all constructed constant CFStrings in a hash table so that
they get uniqued properly. */
@@ -3031,14 +3031,14 @@ add_builtin_field_decl (tree type, const char *name, tree **chain)
return field;
}
-void
-darwin_init_cfstring_builtins (unsigned first_avail)
+tree
+darwin_init_cfstring_builtins (unsigned builtin_cfstring)
{
tree cfsfun, fields, pccfstring_ftype_pcchar;
tree *chain = NULL;
- DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING =
- (enum built_in_function) first_avail;
+ darwin_builtin_cfstring =
+ (enum built_in_function) builtin_cfstring;
/* struct __builtin_CFString {
const int *isa; (will point at
@@ -3084,7 +3084,7 @@ darwin_init_cfstring_builtins (unsigned first_avail)
DECL_LANG_SPECIFIC (cfsfun) = NULL;
(*lang_hooks.dup_lang_specific_decl) (cfsfun);
DECL_BUILT_IN_CLASS (cfsfun) = BUILT_IN_MD;
- DECL_FUNCTION_CODE (cfsfun) = DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING;
+ DECL_FUNCTION_CODE (cfsfun) = darwin_builtin_cfstring;
lang_hooks.builtin_function (cfsfun);
/* extern int __CFConstantStringClassReference[]; */
@@ -3100,6 +3100,8 @@ darwin_init_cfstring_builtins (unsigned first_avail)
/* Initialize the hash table used to hold the constant CFString objects. */
cfstring_htab = htab_create_ggc (31, cfstring_hash, cfstring_eq, NULL);
+
+ return cfstring_type_node;
}
tree
@@ -3108,7 +3110,7 @@ darwin_fold_builtin (tree fndecl, int n_args, tree *argp,
{
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
- if (fcode == DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING)
+ if (fcode == darwin_builtin_cfstring)
{
if (!darwin_constant_cfstrings)
{
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 9cf51e32600..934ab4b8234 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -308,7 +308,8 @@ do { \
#undef SUBTARGET_INIT_BUILTINS
#define SUBTARGET_INIT_BUILTINS \
do { \
- darwin_init_cfstring_builtins ((unsigned) (IX86_BUILTIN_MAX));\
+ ix86_builtins[(int) IX86_BUILTIN_CFSTRING] \
+ = darwin_init_cfstring_builtins ((unsigned) (IX86_BUILTIN_CFSTRING)); \
darwin_rename_builtins (); \
} while(0)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2511817ee83..aa59adacd5e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -24337,6 +24337,9 @@ enum ix86_builtins
IX86_BUILTIN_CVTPS2PH,
IX86_BUILTIN_CVTPS2PH256,
+ /* CFString built-in for darwin */
+ IX86_BUILTIN_CFSTRING,
+
IX86_BUILTIN_MAX
};
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index bd4b1958131..244da0065df 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -433,5 +433,6 @@ extern int darwin_emit_branch_islands;
#define SUBTARGET_INIT_BUILTINS \
do { \
darwin_patch_builtins (); \
- darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_COUNT)); \
+ rs6000_builtin_decls[(unsigned) (RS6000_BUILTIN_CFSTRING)] \
+ = darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_CFSTRING)); \
} while(0)
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index fd6321dcf96..7bd6b20fa07 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -1015,3 +1015,6 @@ RS6000_BUILTIN(RS6000_BUILTIN_RECIPF, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(RS6000_BUILTIN_RSQRTF, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(RS6000_BUILTIN_RSQRT, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(RS6000_BUILTIN_BSWAP_HI, RS6000_BTC_CONST)
+
+/* Darwin CfString builtin. */
+RS6000_BUILTIN(RS6000_BUILTIN_CFSTRING, RS6000_BTC_MISC)