Skip to content

Commit 2598bb5

Browse files
jgu222sys_zuul
authored andcommitted
Move updateDebugLoc() function into help.hpp to avoid static
definition of this function in several .cpp Change-Id: Ieca11064b94b34cbeebcdddd753ceaf28fee5c1d
1 parent 75c7754 commit 2598bb5

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,10 @@ namespace IGC
439439
}
440440
}
441441

442+
// Debug line info helper function
443+
inline void updateDebugLoc(llvm::Instruction* pOrigin, llvm::Instruction* pNew)
444+
{
445+
IGC_ASSERT(pOrigin && pNew && "Expect valid instructions");
446+
pNew->setDebugLoc(pOrigin->getDebugLoc());
447+
}
442448
} // namespace IGC

IGC/Compiler/Optimizer/OpenCLPasses/SubGroupFuncs/SubGroupFuncsResolution.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,6 @@ bool SubGroupFuncsResolution::runOnFunction(Function& F)
235235
return m_changed;
236236
}
237237

238-
// Debug line info helper function
239-
static void updateDebugLoc(Instruction* pOrigin, Instruction* pNew)
240-
{
241-
IGC_ASSERT(pOrigin && pNew && "Expect valid instructions");
242-
pNew->setDebugLoc(pOrigin->getDebugLoc());
243-
}
244-
245238
// Helps to obtain temporary index corresponding to the kernel argument.
246239
// This index will be used during codegen to resolve BTIs for Images (SRVs and UAVs).
247240
void SubGroupFuncsResolution::BTIHelper(llvm::CallInst& CI)

IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ bool WIFuncResolution::runOnFunction(Function& F)
9393
return m_changed;
9494
}
9595

96-
// Debug line info helper function
97-
static void updateDebugLoc(Instruction* pOrigin, Instruction* pNew) {
98-
IGC_ASSERT(pOrigin && pNew && "Expect valid instructions");
99-
pNew->setDebugLoc(pOrigin->getDebugLoc());
100-
}
101-
10296
void WIFuncResolution::visitCallInst(CallInst& CI)
10397
{
10498
if (!CI.getCalledFunction())

0 commit comments

Comments
 (0)