diff options
author | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-11 22:25:15 +0000 |
---|---|---|
committer | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-11 22:25:15 +0000 |
commit | 713c00d6e9a38f64b81a98e60b5533cf75d5602d (patch) | |
tree | 844738a58b7846d7b377fd3594707376a50f0602 /gcc/ada/exp_util.adb | |
parent | c2b56224d60d27cd619e50d0a5250219ea251975 (diff) | |
download | gcc-713c00d6e9a38f64b81a98e60b5533cf75d5602d.tar.gz |
* sem_ch3.adb: Clarify some ???.
* exp_util.adb (Must_Be_Aligned): Removed, replaced by
Exp_Pakd.Known_Aligned_Enough
* sem_ch13.adb (Check_Address_Alignment): Removed, extended
version is moved to Exp_Ch13.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47899 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r-- | gcc/ada/exp_util.adb | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 6aeba91bf5f..f7a52a73a75 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -2488,101 +2488,6 @@ package body Exp_Util is end if; end May_Generate_Large_Temp; - --------------------- - -- Must_Be_Aligned -- - --------------------- - - function Must_Be_Aligned (Obj : Node_Id) return Boolean is - Typ : constant Entity_Id := Etype (Obj); - - function In_Partially_Packed_Record (Comp : Entity_Id) return Boolean; - -- If the component is in a record that contains previous packed - -- components, consider it unaligned because the back-end might - -- choose to pack the rest of the record. Lead to less efficient code, - -- but safer vis-a-vis of back-end choices. - - ----------------------------- - -- Partially_Packed_Record -- - ----------------------------- - - function In_Partially_Packed_Record (Comp : Entity_Id) return Boolean is - Rec_Type : constant Entity_Id := Scope (Comp); - Prev_Comp : Entity_Id; - - begin - Prev_Comp := First_Entity (Rec_Type); - while Present (Prev_Comp) loop - if Is_Packed (Etype (Prev_Comp)) then - return True; - - elsif Prev_Comp = Comp then - return False; - end if; - - Next_Entity (Prev_Comp); - end loop; - - return False; - end In_Partially_Packed_Record; - - -- Start of processing for Must_Be_Aligned - - begin - -- If object is strictly aligned, we can quit now - - if Strict_Alignment (Typ) then - return True; - - -- Case of subscripted array reference - - elsif Nkind (Obj) = N_Indexed_Component then - - -- If we have a pointer to an array, then this is definitely - -- aligned, because pointers always point to aligned versions. - - if Is_Access_Type (Etype (Prefix (Obj))) then - return True; - - -- Otherwise, go look at the prefix - - else - return Must_Be_Aligned (Prefix (Obj)); - end if; - - -- Case of record field - - elsif Nkind (Obj) = N_Selected_Component then - - -- What is significant here is whether the record type is packed - - if Is_Record_Type (Etype (Prefix (Obj))) - and then Is_Packed (Etype (Prefix (Obj))) - then - return False; - - -- Or the component has a component clause which might cause - -- the component to become unaligned (we can't tell if the - -- backend is doing alignment computations). - - elsif Present (Component_Clause (Entity (Selector_Name (Obj)))) then - return False; - - elsif In_Partially_Packed_Record (Entity (Selector_Name (Obj))) then - return False; - - -- In all other cases, go look at prefix - - else - return Must_Be_Aligned (Prefix (Obj)); - end if; - - -- If not selected or indexed component, must be aligned - - else - return True; - end if; - end Must_Be_Aligned; - ---------------------------- -- New_Class_Wide_Subtype -- ---------------------------- |