From 2cc6d66e785130bb757bcb73e96cfffdc2c2f0b7 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 25 Jan 2014 21:16:44 +0100 Subject: new_offsetof: add argument for record type (llvm preliminary work). --- ortho/debug/ortho_debug.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ortho/debug') diff --git a/ortho/debug/ortho_debug.adb b/ortho/debug/ortho_debug.adb index 74c80788f..023729b27 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, -- cgit v1.2.3