diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-08 20:52:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-08 20:52:36 -0700 |
| commit | 8e86121b6ce0f2995050ebe112306ded6bc87ca2 (patch) | |
| tree | 5c7f03ec9a144fa4d38eba67d563aefaaa1f4f9a /source/slang/slang-ast-modifier.h | |
| parent | 448e21adac9ec260d7854076a686bd506bb371ec (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.h | 9 |
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 |
