This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, Ada] Third Argument for pragma Machine_Attribute
- From: Peter Schildmann <peter at schildmann dot info>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 07 Jul 2007 20:29:59 +0200
- Subject: [patch, Ada] Third Argument for pragma Machine_Attribute
The implementation defined pragma Machine_Attribute has an
undocumented third argument 'Info' (see sem_prag.adb):
-- pragma Machine_Attribute (
-- [Entity =>] LOCAL_NAME,
-- [Attribute_Name =>] static_string_EXPRESSION
-- [,[Info =>] static_string_EXPRESSION] );
For example
procedure Handler;
pragma Machine_Attribute (Handler, "interrupt", "FIQ");
procedure Handler is ...
is equivalent to
void handler (void) __attribute__ ((interrupt ("FIQ")));
The following small patch makes the 'Info' argument work:
--- gcc-4.3-20070615-orig/gcc/ada/decl.c 2007-06-10 20:36:40.000000000
+0200
+++ gcc-4.3-20070615/gcc/ada/decl.c 2007-07-07 19:41:06.000000000 +0200
@@ -4870,11 +4870,8 @@
if (Present (Next (Next (First (gnat_assoc))))
&& (Nkind (Expression (Next (Next (First (gnat_assoc)))))
== N_String_Literal))
- gnu_arg1 = get_identifier (TREE_STRING_POINTER
- (gnat_to_gnu
- (Expression
- (Next (Next
- (First (gnat_assoc)))))));
+ gnu_arg1 = gnat_to_gnu (Expression
+ (Next (Next (First (gnat_assoc)))));
}
switch (Get_Pragma_Id (Chars (gnat_temp)))
--
Peter Schildmann