diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-01-15 06:12:10 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-01-15 06:12:10 +0100 |
commit | d68bc3f41ad8a750eda9c50878c6728a84ad3097 (patch) | |
tree | 9284690b0797e3ffed8839611d4b8e53ee1d5894 /ortho/gcc/ortho-lang.c | |
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/gcc/ortho-lang.c')
-rw-r--r-- | ortho/gcc/ortho-lang.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ortho/gcc/ortho-lang.c b/ortho/gcc/ortho-lang.c index 370bdd633..900ca17ae 100644 --- a/ortho/gcc/ortho-lang.c +++ b/ortho/gcc/ortho-lang.c @@ -1431,6 +1431,12 @@ new_sizeof (tree atype, tree rtype) return fold (build1 (NOP_EXPR, rtype, size)); } +tree +new_alignof (tree atype, tree rtype) +{ + return build_int_cstu (rtype, TYPE_ALIGN_UNIT (atype)); +} + /* Convert the array expression EXP to a pointer. */ static tree array_to_pointer_conversion (tree exp); |