LowerGlobalDtors: Use use_empty instead of getNumUses == 0 (#136337)

This commit is contained in:
Matt Arsenault
2025-04-18 21:18:00 +02:00
committed by GitHub
parent cfc035a2b1
commit 34f34665ac

View File

@@ -146,7 +146,7 @@ static bool runImpl(Module &M) {
// the program never exits) we can simply return early and clear out
// @llvm.global_dtors.
if (auto F = dyn_cast<Function>(AtExit.getCallee())) {
if (F && F->hasExactDefinition() && F->getArg(0)->getNumUses() == 0) {
if (F && F->hasExactDefinition() && F->getArg(0)->use_empty()) {
GV->eraseFromParent();
return true;
}