From 8e86121b6ce0f2995050ebe112306ded6bc87ca2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 8 May 2024 20:52:36 -0700 Subject: Support `[__ref]` attribute to make `this` pass by reference. (#4139) Fixes #4110. --- source/slang/slang-ast-modifier.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ast-modifier.h') diff --git a/source/slang/slang-ast-modifier.h b/source/slang/slang-ast-modifier.h index 9a27b3c06..03d3e6fcf 100644 --- a/source/slang/slang-ast-modifier.h +++ b/source/slang/slang-ast-modifier.h @@ -1004,13 +1004,20 @@ class NonmutatingAttribute : public Attribute }; // A `[constref]` attribute, which indicates that the `this` parameter of -// a member function should be passed by reference. +// a member function should be passed by const reference. // class ConstRefAttribute : public Attribute { SLANG_AST_CLASS(ConstRefAttribute) }; +// A `[ref]` attribute, which indicates that the `this` parameter of +// a member function should be passed by reference. +// +class RefAttribute : public Attribute +{ + SLANG_AST_CLASS(RefAttribute) +}; // A `[__readNone]` attribute, which indicates that a function // computes its results strictly based on argument values, without -- cgit v1.2.3