Skip to content

Commit

Permalink
remove external linkage.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhachen committed Oct 10, 2023
1 parent d70bafb commit 2875336
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions llpc/lower/llpcSpirvLowerRayTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,18 +654,11 @@ PreservedAnalyses SpirvLowerRayTracing::run(Module &module, ModuleAnalysisManage
func->eraseFromParent();
}

StringRef traceRayGetInstanceIndx =
m_context->getPipelineContext()->getRayTracingFunctionName(Vkgc::RT_ENTRY_INSTANCE_INDEX);

StringRef traceRayGetInstanceId =
m_context->getPipelineContext()->getRayTracingFunctionName(Vkgc::RT_ENTRY_INSTANCE_ID);

// Newly generated implementation functions are external linkage, fix that.
for (auto funcIt = module.begin(), funcEnd = module.end(); funcIt != funcEnd;) {
Function *func = &*funcIt++;
if (func->getLinkage() == GlobalValue::ExternalLinkage && !func->empty()) {
if (!func->getName().startswith(module.getName()) && !func->getName().startswith(traceRayGetInstanceId) &&
!func->getName().startswith(traceRayGetInstanceIndx)) {
if (!func->getName().startswith(module.getName())) {
func->setLinkage(GlobalValue::InternalLinkage);
}
}
Expand Down

0 comments on commit 2875336

Please sign in to comment.