From e7a83323bfc4dd698ef491375a37c65c83915951 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Tue, 29 May 2018 11:39:55 -0700 Subject: Fix global atomic functions (#582) Fixes #581 This change adds a new parameter passing mode `__ref` to exist alongisde `in`, `out`, and `inout`. The `__ref` modifier indicates true by-reference parameter passing (whereas `inout` is copy-in-copy-out). This is not intended to be something that users interact with directly, but rather a low-level feature that lets us provide a correct signature for the `Interlocked*()` operations in the standard library. Most of the support for passing what are logically addresses around already exists in the IR, so the majority of the work here is just in introducing the new type `Ref` and then using it appropriately when lowering `__ref` parameters/arguments to the IR. --- source/slang/parser.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang/parser.cpp') diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index ab95be5ac..ad4eef9a6 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -4399,6 +4399,7 @@ namespace Slang MODIFIER(input, InputModifier); MODIFIER(out, OutModifier); MODIFIER(inout, InOutModifier); + MODIFIER(__ref, RefModifier); MODIFIER(const, ConstModifier); MODIFIER(instance, InstanceModifier); MODIFIER(__builtin, BuiltinModifier); -- cgit v1.2.3