From 245466d89cfe54b78da486f06d470bc6daaf4625 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Feb 2023 16:44:04 -0800 Subject: Remove `SharedIRBuilder`. (#2657) Co-authored-by: Yong He --- source/slang/slang-ir-explicit-global-init.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source/slang/slang-ir-explicit-global-init.cpp') diff --git a/source/slang/slang-ir-explicit-global-init.cpp b/source/slang/slang-ir-explicit-global-init.cpp index 94c065514..a65118d5a 100644 --- a/source/slang/slang-ir-explicit-global-init.cpp +++ b/source/slang/slang-ir-explicit-global-init.cpp @@ -40,8 +40,6 @@ struct MoveGlobalVarInitializationToEntryPointsPass { IRModule* m_module; - SharedIRBuilder* m_sharedBuilder; - // In the Slang IR, a global variable represents a pointer // to the storage for the variable but it *also* encodes // the logic used to compute the initial value of that @@ -72,9 +70,6 @@ struct MoveGlobalVarInitializationToEntryPointsPass { m_module = module; - SharedIRBuilder sharedBuilder(module); - m_sharedBuilder = &sharedBuilder; - // We start by looking for global variables with // initialization logic in the IR, and processing // each to produce a split variable (now without @@ -120,7 +115,7 @@ struct MoveGlobalVarInitializationToEntryPointsPass void processGlobalVarWithInit(IRGlobalVar* globalVar, IRBlock* firstBlock) { - IRBuilder builder(m_sharedBuilder); + IRBuilder builder(m_module); builder.setInsertBefore(globalVar); // Becaue an `IRGlobalVar` reprsents a pointer to the storage @@ -174,7 +169,7 @@ struct MoveGlobalVarInitializationToEntryPointsPass // We are going to insert initiailization logic at the start // of the first block of the entry point. // - IRBuilder builder(m_sharedBuilder); + IRBuilder builder(m_module); builder.setInsertBefore(firstBlock->getFirstOrdinaryInst()); for( auto globalVarInfo : m_globalVarsWithInit ) -- cgit v1.2.3