Skip to content

Commit 204ea53

Browse files
author
Wael Yehia
committed
simplify IsLocalFunc by using isStrongDefinitionForLinker() && isDSOLocal()
1 parent 13868e8 commit 204ea53

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,20 +3389,7 @@ void PPCAIXAsmPrinter::emitModuleCommandLines(Module &M) {
33893389
static bool TOCRestoreNeededForCallToImplementation(const GlobalIFunc &GI) {
33903390
// Query if the given function is local to the load module.
33913391
auto IsLocalFunc = [](const Function *F) {
3392-
// Static functions are local
3393-
if (F->getLinkage() == GlobalValue::InternalLinkage)
3394-
return true;
3395-
// We treat declarations as non-local because the visibility attribute
3396-
// on a declaration might not match the definition, and AIX linker
3397-
// ignores the visibility on a reference.
3398-
if (F->isDeclarationForLinker())
3399-
return false;
3400-
// hidden or protected visibility definitions cannot be preempted.
3401-
if (F->getVisibility() == GlobalValue::HiddenVisibility ||
3402-
F->getVisibility() == GlobalValue::ProtectedVisibility)
3403-
return true;
3404-
3405-
return false;
3392+
return F->isStrongDefinitionForLinker() && F->isDSOLocal();
34063393
};
34073394
// Recursive walker that checks if all possible runtime values of the given
34083395
// llvm::Value are addresses of local functions.

0 commit comments

Comments
 (0)