Bugzilla – Attachment 66 Details for
Bug 114
Add support for the GCC 'naked' attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug creation and email sending has been disabled, file new bugs at
gcc.gnu.org/bugzilla
[patch]
Patch to add target attributes into lookup table
attribs.patch (text/plain), 2.12 KB, created by
Iain Buclaw
on 2014-04-07 13:19:24 CEST
(
hide
)
Description:
Patch to add target attributes into lookup table
Filename:
MIME Type:
Creator:
Iain Buclaw
Created:
2014-04-07 13:19:24 CEST
Size:
2.12 KB
patch
obsolete
>diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc >index 08f1b31..1350a33 100644 >--- a/gcc/d/d-codegen.cc >+++ b/gcc/d/d-codegen.cc >@@ -792,20 +792,29 @@ d_attribute_p (const char* name) > { > static StringTable* table; > >- if(!table) >+ if(table == NULL) > { >+ // Build the table of attributes exposed to the language. >+ // Common and format attributes are kept internal. > size_t n = 0; >- for (const attribute_spec *p = d_attribute_table; p->name; p++) >+ table = new StringTable(); >+ >+ for (const attribute_spec *p = lang_hooks.attribute_table; p->name; p++) > n++; > >- if(n == 0) >- return false; >+ for (const attribute_spec *p = targetm.attribute_table; p->name; p++) >+ n++; > >- table = new StringTable(); >- table->_init(n); >+ if(n != 0) >+ { >+ table->_init(n); >+ >+ for (const attribute_spec *p = lang_hooks.attribute_table; p->name; p++) >+ table->insert(p->name, strlen(p->name)); > >- for (const attribute_spec *p = d_attribute_table; p->name; p++) >- table->insert(p->name, strlen(p->name)); >+ for (const attribute_spec *p = targetm.attribute_table; p->name; p++) >+ table->insert(p->name, strlen(p->name)); >+ } > } > > return table->lookup(name, strlen(name)) != NULL; >diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc >index ea8549f..f1e4891 100644 >--- a/gcc/d/d-lang.cc >+++ b/gcc/d/d-lang.cc >@@ -46,7 +46,7 @@ static tree d_handle_target_attribute (tree *, tree, tree, int, bool *); > > static char lang_name[6] = "GNU D"; > >-const attribute_spec d_attribute_table[] = >+static const attribute_spec d_attribute_table[] = > { > { "noinline", 0, 0, true, false, false, > d_handle_noinline_attribute, false }, >diff --git a/gcc/d/d-lang.h b/gcc/d/d-lang.h >index 9f552f2..4ee8da2 100644 >--- a/gcc/d/d-lang.h >+++ b/gcc/d/d-lang.h >@@ -202,7 +202,6 @@ extern void set_block (tree); > > /* In d-builtins.c */ > extern const attribute_spec d_builtins_attribute_table[]; >-extern const attribute_spec d_attribute_table[]; > extern const attribute_spec d_format_attribute_table[]; > tree d_builtin_function (tree); > void d_init_builtins (void);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 114
:
64
|
65
| 66