diff options
| author | Yong He <yonghe@outlook.com> | 2022-11-09 19:19:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-09 19:19:17 -0800 |
| commit | 004f6e30b5df3a3df2c26fe5c4a5e78c49f71166 (patch) | |
| tree | cbc942746bab043da0eb5298993d95f9665dfddf /source/slang/slang-ast-support-types.cpp | |
| parent | cedd93690c63188cf98e452c9d104cf51aad6c4e (diff) | |
Add `[ForwardDerivativeOf]` attribute. (#2501)
* Add [ForwardDerivativeOf] attribute.
* Fix handling around phi nodes.
* Fixes.
* Remove IR opcode for ForwardDerivativeOfDecoration.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-support-types.cpp')
| -rw-r--r-- | source/slang/slang-ast-support-types.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/slang-ast-support-types.cpp b/source/slang/slang-ast-support-types.cpp index 7133f2a65..1f30e0238 100644 --- a/source/slang/slang-ast-support-types.cpp +++ b/source/slang/slang-ast-support-types.cpp @@ -14,4 +14,24 @@ QualType::QualType(Type* type) } } +void removeModifier(ModifiableSyntaxNode* syntax, Modifier* toRemove) +{ + Modifier* prev = nullptr; + for (auto modifier = syntax->modifiers.first; modifier; modifier = modifier->next) + { + if (modifier == toRemove) + { + if (prev) + { + prev->next = modifier->next; + } + else + { + syntax->modifiers.first = syntax->modifiers.first->next; + } + break; + } + prev = modifier; + } +} } |
