From bd6d22ed4ddf3e45aecd5ddbd49957b24fe600e0 Mon Sep 17 00:00:00 2001 From: february cozzocrea Date: Thu, 14 Mar 2024 11:43:39 -0700 Subject: [PATCH] make qual_handling enum for canonicalize() public --- src/aro/Type.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/aro/Type.zig b/src/aro/Type.zig index fb617d07..35991eac 100644 --- a/src/aro/Type.zig +++ b/src/aro/Type.zig @@ -1138,12 +1138,18 @@ pub fn alignof(ty: Type, comp: *const Compilation) u29 { }; } +// This enum should be kept public because it is used by the downstream zig compiler source +pub const QualHandling = enum { + standard, + preserve_quals, +}; + /// Canonicalize a possibly-typeof() type. If the type is not a typeof() type, simply /// return it. Otherwise, determine the actual qualified type. /// The `qual_handling` parameter can be used to return the full set of qualifiers /// added by typeof() operations, which is useful when determining the elemType of /// arrays and pointers. -pub fn canonicalize(ty: Type, qual_handling: enum { standard, preserve_quals }) Type { +pub fn canonicalize(ty: Type, qual_handling: QualHandling) Type { var cur = ty; if (cur.specifier == .attributed) { cur = cur.data.attributed.base;