From 1292d28c8b613982b7e44140515a4d17aa949349 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 18 Apr 2025 19:18:52 +0200 Subject: [PATCH] LowerGlobalDtors: Use use_empty instead of getNumUses == 0 --- llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp index ff72ba073ad0e..df3a2a94b7ddb 100644 --- a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp +++ b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp @@ -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(AtExit.getCallee())) { - if (F && F->hasExactDefinition() && F->getArg(0)->getNumUses() == 0) { + if (F && F->hasExactDefinition() && F->getArg(0)->use_empty()) { GV->eraseFromParent(); return true; }