diff options
author | Tristan Gingold | 2014-01-24 06:54:45 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-01-24 06:54:45 +0100 |
commit | dd191d5f5d6ac2dc48ed1ee4fb4d1bd09dce8b73 (patch) | |
tree | 9f0a22326ca6813321f2b73729049f8ba07072a0 /ortho | |
parent | 9567c15d0db2d39ce8ea83b3dff96e7e8f852243 (diff) | |
download | ghdl-dd191d5f5d6ac2dc48ed1ee4fb4d1bd09dce8b73.tar.gz ghdl-dd191d5f5d6ac2dc48ed1ee4fb4d1bd09dce8b73.tar.bz2 ghdl-dd191d5f5d6ac2dc48ed1ee4fb4d1bd09dce8b73.zip |
mcode: add get_alignof_type.
Diffstat (limited to 'ortho')
-rw-r--r-- | ortho/mcode/ortho_code-consts.adb | 7 | ||||
-rw-r--r-- | ortho/mcode/ortho_code-consts.ads | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ortho/mcode/ortho_code-consts.adb b/ortho/mcode/ortho_code-consts.adb index c6d2020..1122b8e 100644 --- a/ortho/mcode/ortho_code-consts.adb +++ b/ortho/mcode/ortho_code-consts.adb @@ -488,6 +488,13 @@ package body Ortho_Code.Consts is end if; end New_Alignof; + function Get_Alignof_Type (Cst : O_Cnode) return O_Tnode + is + function To_Cnode_Sizeof is new Ada.Unchecked_Conversion + (Cnode_Common, Cnode_Sizeof); + begin + return To_Cnode_Sizeof (Cnodes.Table (Cst + 1)).Atype; + end Get_Alignof_Type; function New_Offsetof (Field : O_Fnode; Rtype : O_Tnode) return O_Cnode is begin diff --git a/ortho/mcode/ortho_code-consts.ads b/ortho/mcode/ortho_code-consts.ads index 603a8a1..7059b56 100644 --- a/ortho/mcode/ortho_code-consts.ads +++ b/ortho/mcode/ortho_code-consts.ads @@ -56,9 +56,12 @@ package Ortho_Code.Consts is -- Declaration for an address. function Get_Const_Decl (Cst : O_Cnode) return O_Dnode; - -- Get the type whose size is expected. + -- Get the type from an OC_Sizeof node. function Get_Sizeof_Type (Cst : O_Cnode) return O_Tnode; + -- Get the type from an OC_Alignof node. + function Get_Alignof_Type (Cst : O_Cnode) return O_Tnode; + -- Get the value of a named literal. --function Get_Const_Literal (Cst : O_Cnode) return Uns32; |