diff options
author | Tristan Gingold | 2014-01-15 06:12:10 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-01-15 06:12:10 +0100 |
commit | d68bc3f41ad8a750eda9c50878c6728a84ad3097 (patch) | |
tree | 9284690b0797e3ffed8839611d4b8e53ee1d5894 /ortho/debug/ortho_debug.adb | |
parent | 9b22b46458f2c80d87ffd957aa7df78cb98ee710 (diff) | |
download | ghdl-d68bc3f41ad8a750eda9c50878c6728a84ad3097.tar.gz ghdl-d68bc3f41ad8a750eda9c50878c6728a84ad3097.tar.bz2 ghdl-d68bc3f41ad8a750eda9c50878c6728a84ad3097.zip |
Add Alignof constant to get the alignment of a type.
Diffstat (limited to 'ortho/debug/ortho_debug.adb')
-rw-r--r-- | ortho/debug/ortho_debug.adb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ortho/debug/ortho_debug.adb b/ortho/debug/ortho_debug.adb index e2307b9..723fe3c 100644 --- a/ortho/debug/ortho_debug.adb +++ b/ortho/debug/ortho_debug.adb @@ -425,6 +425,20 @@ package body Ortho_Debug is S_Type => Atype); end New_Sizeof; + function New_Alignof (Atype : O_Tnode; Rtype : O_Tnode) return O_Cnode + is + subtype O_Cnode_Alignof_Type is O_Cnode_Type (OC_Alignof_Lit); + begin + if Rtype.Kind /= ON_Unsigned_Type then + raise Type_Error; + end if; + Check_Complete_Type (Atype); + return new O_Cnode_Alignof_Type'(Kind => OC_Alignof_Lit, + Ctype => Rtype, + Ref => False, + S_Type => Atype); + end New_Alignof; + function New_Offsetof (Field : O_Fnode; Rtype : O_Tnode) return O_Cnode is subtype O_Cnode_Offsetof_Type is O_Cnode_Type (OC_Offsetof_Lit); |