summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ortho/mcode/ortho_code-consts.adb7
-rw-r--r--ortho/mcode/ortho_code-consts.ads5
2 files changed, 11 insertions, 1 deletions
diff --git a/ortho/mcode/ortho_code-consts.adb b/ortho/mcode/ortho_code-consts.adb
index c6d2020..1122b8e 100644
--- a/ortho/mcode/ortho_code-consts.adb
+++ b/ortho/mcode/ortho_code-consts.adb
@@ -488,6 +488,13 @@ package body Ortho_Code.Consts is
end if;
end New_Alignof;
+ function Get_Alignof_Type (Cst : O_Cnode) return O_Tnode
+ is
+ function To_Cnode_Sizeof is new Ada.Unchecked_Conversion
+ (Cnode_Common, Cnode_Sizeof);
+ begin
+ return To_Cnode_Sizeof (Cnodes.Table (Cst + 1)).Atype;
+ end Get_Alignof_Type;
function New_Offsetof (Field : O_Fnode; Rtype : O_Tnode) return O_Cnode is
begin
diff --git a/ortho/mcode/ortho_code-consts.ads b/ortho/mcode/ortho_code-consts.ads
index 603a8a1..7059b56 100644
--- a/ortho/mcode/ortho_code-consts.ads
+++ b/ortho/mcode/ortho_code-consts.ads
@@ -56,9 +56,12 @@ package Ortho_Code.Consts is
-- Declaration for an address.
function Get_Const_Decl (Cst : O_Cnode) return O_Dnode;
- -- Get the type whose size is expected.
+ -- Get the type from an OC_Sizeof node.
function Get_Sizeof_Type (Cst : O_Cnode) return O_Tnode;
+ -- Get the type from an OC_Alignof node.
+ function Get_Alignof_Type (Cst : O_Cnode) return O_Tnode;
+
-- Get the value of a named literal.
--function Get_Const_Literal (Cst : O_Cnode) return Uns32;