summaryrefslogtreecommitdiff
path: root/ortho/debug
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/debug
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/debug')
-rw-r--r--ortho/debug/ortho_debug.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/ortho/debug/ortho_debug.adb b/ortho/debug/ortho_debug.adb
index 74c8078..023729b 100644
--- a/ortho/debug/ortho_debug.adb
+++ b/ortho/debug/ortho_debug.adb
@@ -437,13 +437,17 @@ package body Ortho_Debug is
S_Type => Atype);
end New_Alignof;
- function New_Offsetof (Field : O_Fnode; Rtype : O_Tnode) return O_Cnode
+ function New_Offsetof (Rec_Type : O_Tnode; Field : O_Fnode; Rtype : O_Tnode)
+ return O_Cnode
is
subtype O_Cnode_Offsetof_Type is O_Cnode_Type (OC_Offsetof_Lit);
begin
if Rtype.Kind /= ON_Unsigned_Type then
raise Type_Error;
end if;
+ if Field.Parent /= Rec_Type then
+ raise Type_Error;
+ end if;
return new O_Cnode_Offsetof_Type'(Kind => OC_Offsetof_Lit,
Ctype => Rtype,
Ref => False,