summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-modifier.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-05-08 20:52:36 -0700
committerGitHub <noreply@github.com>2024-05-08 20:52:36 -0700
commit8e86121b6ce0f2995050ebe112306ded6bc87ca2 (patch)
tree5c7f03ec9a144fa4d38eba67d563aefaaa1f4f9a /source/slang/slang-ast-modifier.h
parent448e21adac9ec260d7854076a686bd506bb371ec (diff)
Support `[__ref]` attribute to make `this` pass by reference. (#4139)
Fixes #4110.
Diffstat (limited to 'source/slang/slang-ast-modifier.h')
-rw-r--r--source/slang/slang-ast-modifier.h9
1 files changed, 8 insertions, 1 deletions
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