diff options
| author | Yong He <yonghe@outlook.com> | 2023-02-16 16:44:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-16 16:44:04 -0800 |
| commit | 245466d89cfe54b78da486f06d470bc6daaf4625 (patch) | |
| tree | 522e0af1a9d2756182e143cdc85031ea1bbc2aa0 /source/slang/slang-ir-clone.cpp | |
| parent | 4c4826d47eeef4675daae4ae53ff76f4d5ebd84a (diff) | |
Remove `SharedIRBuilder`. (#2657)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-clone.cpp')
| -rw-r--r-- | source/slang/slang-ir-clone.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/slang/slang-ir-clone.cpp b/source/slang/slang-ir-clone.cpp index 8b8b28f09..050d1e392 100644 --- a/source/slang/slang-ir-clone.cpp +++ b/source/slang/slang-ir-clone.cpp @@ -124,19 +124,18 @@ struct IRCloningOldNewPair // static void _cloneInstDecorationsAndChildren( IRCloneEnv* env, - SharedIRBuilder* sharedBuilder, + IRModule* module, IRInst* oldInst, IRInst* newInst) { SLANG_ASSERT(env); - SLANG_ASSERT(sharedBuilder); SLANG_ASSERT(oldInst); SLANG_ASSERT(newInst); // We will set up an IR builder that inserts // into the new parent instruction. // - IRBuilder builderStorage(sharedBuilder); + IRBuilder builderStorage(module); auto builder = &builderStorage; builder->setInsertInto(newInst); @@ -202,7 +201,7 @@ static void _cloneInstDecorationsAndChildren( auto oldChild = pair.oldInst; auto newChild = pair.newInst; - _cloneInstDecorationsAndChildren(env, sharedBuilder, oldChild, newChild); + _cloneInstDecorationsAndChildren(env, module, oldChild, newChild); } } @@ -214,11 +213,11 @@ static void _cloneInstDecorationsAndChildren( // void cloneInstDecorationsAndChildren( IRCloneEnv* env, - SharedIRBuilder* sharedBuilder, + IRModule* module, IRInst* oldInst, IRInst* newInst) { - SLANG_ASSERT(sharedBuilder); + SLANG_ASSERT(module); SLANG_ASSERT(oldInst); SLANG_ASSERT(newInst); @@ -233,7 +232,7 @@ void cloneInstDecorationsAndChildren( subEnv = &subEnvStorage; subEnv->parent = env; } - _cloneInstDecorationsAndChildren(subEnv, sharedBuilder, oldInst, newInst); + _cloneInstDecorationsAndChildren(subEnv, module, oldInst, newInst); } // The convenience function `cloneInst` just sequences the @@ -273,7 +272,7 @@ IRInst* cloneInst( env->mapOldValToNew.Add(oldInst, newInst); cloneInstDecorationsAndChildren( - env, builder->getSharedBuilder(), oldInst, newInst); + env, builder->getModule(), oldInst, newInst); return newInst; } @@ -284,8 +283,7 @@ void cloneDecoration( IRInst* newParent, IRModule* module) { - SharedIRBuilder sharedBuilder(module); - IRBuilder builder(sharedBuilder); + IRBuilder builder(module); if(auto first = newParent->getFirstDecorationOrChild()) builder.setInsertBefore(first); |
