summaryrefslogtreecommitdiff
path: root/ortho/gcc/ortho-lang.c
diff options
context:
space:
mode:
authorTristan Gingold2014-01-25 21:16:44 +0100
committerTristan Gingold2014-01-25 21:16:44 +0100
commit2cc6d66e785130bb757bcb73e96cfffdc2c2f0b7 (patch)
tree0e1c76137b2da38b1b065d519f005a00a90c4ad9 /ortho/gcc/ortho-lang.c
parent2bfd9df129c8517776455c6c402a63b79b841257 (diff)
downloadghdl-2cc6d66e785130bb757bcb73e96cfffdc2c2f0b7.tar.gz
ghdl-2cc6d66e785130bb757bcb73e96cfffdc2c2f0b7.tar.bz2
ghdl-2cc6d66e785130bb757bcb73e96cfffdc2c2f0b7.zip
new_offsetof: add argument for record type (llvm preliminary work).
Diffstat (limited to 'ortho/gcc/ortho-lang.c')
-rw-r--r--ortho/gcc/ortho-lang.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ortho/gcc/ortho-lang.c b/ortho/gcc/ortho-lang.c
index 5404afb..fe02dbc 100644
--- a/ortho/gcc/ortho-lang.c
+++ b/ortho/gcc/ortho-lang.c
@@ -1442,13 +1442,15 @@ new_access_element (tree acc)
}
tree
-new_offsetof (tree field, tree rtype)
+new_offsetof (tree rec_type, tree field, tree rtype)
{
tree off;
tree bit_off;
HOST_WIDE_INT pos;
tree res;
+ gcc_assert (DECL_CONTEXT (field) == rec_type);
+
off = DECL_FIELD_OFFSET (field);
/* The offset must be a constant. */