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/compiler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/compiler.h') diff --git a/source/slang/compiler.h b/source/slang/compiler.h index e7c40bdc8..526168e3a 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -520,6 +520,9 @@ namespace Slang // Construct the type `InOut` RefPtr getInOutType(RefPtr valueType); + // Construct the type `Ref` + RefPtr getRefType(RefPtr valueType); + // Construct a pointer type like `Ptr`, but where // the actual type name for the pointer type is given by `ptrTypeName` RefPtr getPtrType(RefPtr valueType, char const* ptrTypeName); -- cgit v1.2.3