diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-06-02 10:27:13 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-01 19:27:13 -0700 |
| commit | 0bc89bc13251fedc9ed90cf473d2e6eb7fda3abf (patch) | |
| tree | 564e5160660c8b65e9f7b9b15c1e7d3c0d863f11 /source/slang/slang-ir.cpp | |
| parent | c5a453e56985022deb820cbbb2ff5cd6a8347e34 (diff) | |
Prevent hoisting of non-hoistable instructions in non-function values with code (#4250)
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 3e96d61eb..b6d000d20 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -8530,6 +8530,18 @@ namespace Slang return nullptr; } + bool hasDescendent(IRInst* inst, IRInst* child) + { + auto parent = child->getParent(); + while (parent) + { + if (inst == parent) + return true; + parent = parent->getParent(); + } + return false; + } + IRInst* getGenericReturnVal(IRInst* inst) { if (auto gen = as<IRGeneric>(inst)) |
