diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-09-15 12:37:32 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-09-15 12:37:32 -0700 |
| commit | 19691c0b174f283ffe5b6c3fe8533ef458736064 (patch) | |
| tree | 802390ce8ad5d29cc72450262efd4b13140f5f20 /src/Air.zig | |
| parent | e5fd45003e56f152364a4bdc609fda07a6b524fd (diff) | |
| download | zig-19691c0b174f283ffe5b6c3fe8533ef458736064.tar.gz zig-19691c0b174f283ffe5b6c3fe8533ef458736064.zip | |
stage2: implement `@fence`
Diffstat (limited to 'src/Air.zig')
| -rw-r--r-- | src/Air.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Air.zig b/src/Air.zig index 29deb9a523..e4289c2826 100644 --- a/src/Air.zig +++ b/src/Air.zig @@ -127,6 +127,10 @@ pub const Inst = struct { /// Lowers to a hardware trap instruction, or the next best thing. /// Result type is always void. breakpoint, + /// Lowers to a memory fence instruction. + /// Result type is always void. + /// Uses the `fence` field. + fence, /// Function call. /// Result type is the return type of the function being called. /// Uses the `pl_op` field with the `Call` payload. operand is the callee. @@ -380,6 +384,7 @@ pub const Inst = struct { line: u32, column: u32, }, + fence: std.builtin.AtomicOrder, // Make sure we don't accidentally add a field to make this union // bigger than expected. Note that in Debug builds, Zig is allowed @@ -566,6 +571,7 @@ pub fn typeOfIndex(air: Air, inst: Air.Inst.Index) Type { .breakpoint, .dbg_stmt, .store, + .fence, => return Type.initTag(.void), .ptrtoint, |
