diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-09 14:59:55 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-09 14:59:55 +0000 |
commit | eba2aae511fc844543f6d2845fac82544617f76d (patch) | |
tree | 4cb47b83e2b0f42ab42d54d9b0a4fb49b2a68d93 /gcc/ada/sem_util.adb | |
parent | 8e14cc65d0226cf4a44421a8183cd0bccd651897 (diff) | |
download | gcc-eba2aae511fc844543f6d2845fac82544617f76d.tar.gz |
2010-10-09 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 165222
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@165232 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 99 |
1 files changed, 34 insertions, 65 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 83fee324fd2..1550a475435 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -245,6 +245,28 @@ package body Sem_Util is Analyze (N); end Add_Global_Declaration; + ----------------- + -- Addressable -- + ----------------- + + -- For now, just 8/16/32/64. but analyze later if AAMP is special??? + + function Addressable (V : Uint) return Boolean is + begin + return V = Uint_8 or else + V = Uint_16 or else + V = Uint_32 or else + V = Uint_64; + end Addressable; + + function Addressable (V : Int) return Boolean is + begin + return V = 8 or else + V = 16 or else + V = 32 or else + V = 64; + end Addressable; + ----------------------- -- Alignment_In_Bits -- ----------------------- @@ -3468,71 +3490,6 @@ package body Sem_Util is end if; end First_Actual; - ------------------------- - -- Full_Qualified_Name -- - ------------------------- - - function Full_Qualified_Name (E : Entity_Id) return String_Id is - Res : String_Id; - pragma Warnings (Off, Res); - - function Internal_Full_Qualified_Name (E : Entity_Id) return String_Id; - -- Compute recursively the qualified name without NUL at the end - - ---------------------------------- - -- Internal_Full_Qualified_Name -- - ---------------------------------- - - function Internal_Full_Qualified_Name (E : Entity_Id) return String_Id is - Ent : Entity_Id := E; - Parent_Name : String_Id := No_String; - - begin - -- Deals properly with child units - - if Nkind (Ent) = N_Defining_Program_Unit_Name then - Ent := Defining_Identifier (Ent); - end if; - - -- Compute qualification recursively (only "Standard" has no scope) - - if Present (Scope (Scope (Ent))) then - Parent_Name := Internal_Full_Qualified_Name (Scope (Ent)); - end if; - - -- Every entity should have a name except some expanded blocks - -- don't bother about those. - - if Chars (Ent) = No_Name then - return Parent_Name; - end if; - - -- Add a period between Name and qualification - - if Parent_Name /= No_String then - Start_String (Parent_Name); - Store_String_Char (Get_Char_Code ('.')); - - else - Start_String; - end if; - - -- Generates the entity name in upper case - - Get_Decoded_Name_String (Chars (Ent)); - Set_All_Upper_Case; - Store_String_Chars (Name_Buffer (1 .. Name_Len)); - return End_String; - end Internal_Full_Qualified_Name; - - -- Start of processing for Full_Qualified_Name - - begin - Res := Internal_Full_Qualified_Name (E); - Store_String_Char (Get_Char_Code (ASCII.NUL)); - return End_String; - end Full_Qualified_Name; - ----------------------- -- Gather_Components -- ----------------------- @@ -5302,6 +5259,18 @@ package body Sem_Util is end if; end Has_Tagged_Component; + ------------------------- + -- Implementation_Kind -- + ------------------------- + + function Implementation_Kind (Subp : Entity_Id) return Name_Id is + Impl_Prag : constant Node_Id := Get_Rep_Pragma (Subp, Name_Implemented); + begin + pragma Assert (Present (Impl_Prag)); + return + Chars (Expression (Last (Pragma_Argument_Associations (Impl_Prag)))); + end Implementation_Kind; + -------------------------- -- Implements_Interface -- -------------------------- |