lib/accy/src/kernel/interpret/policy.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 pub const Unhandled = struct {
2 indexed: Action = .lower,
3 regions: Action = .lower,
4
5 pub const Action = enum {
6 lower,
7 bind,
8 };
9 };
10
11 pub const lower = Unhandled{};
12 pub const indexed = Unhandled{ .indexed = .bind };
13 pub const transparent = Unhandled{ .indexed = .bind, .regions = .bind };
14
15 pub fn implUnhandled(comptime Impl: type, comptime fallback: Unhandled) Unhandled {
16 if (comptime @hasDecl(Impl, "unhandled")) {
17 const value: Unhandled = Impl.unhandled;
18 return value;
19 }
20 return fallback;
21 }