[ModuleUtils] Remove dead arg from filterDeadComdatFunctions() (NFC)

The module argument is no longer used.
This commit is contained in:
Nikita Popov 2022-01-07 09:12:16 +01:00
parent 291660e62f
commit c8189da201
5 changed files with 5 additions and 6 deletions

View File

@ -92,7 +92,7 @@ void appendToCompilerUsed(Module &M, ArrayRef<GlobalValue *> Values);
/// DeadComdatFunctions are those where every member of the comdat is listed
/// and thus removing them is safe (provided *all* are removed).
void filterDeadComdatFunctions(
Module &M, SmallVectorImpl<Function *> &DeadComdatFunctions);
SmallVectorImpl<Function *> &DeadComdatFunctions);
/// Produce a unique identifier for this module by taking the MD5 sum of
/// the names of the module's strong external symbols that are not comdat

View File

@ -117,7 +117,7 @@ PreservedAnalyses AlwaysInlinerPass::run(Module &M,
if (!InlinedFunctions.empty()) {
// Now we just have the comdat functions. Filter out the ones whose comdats
// are not actually dead.
filterDeadComdatFunctions(M, InlinedFunctions);
filterDeadComdatFunctions(InlinedFunctions);
// The remaining functions are actually dead.
for (Function *F : InlinedFunctions) {
M.getFunctionList().erase(F);

View File

@ -660,7 +660,7 @@ bool LegacyInlinerBase::removeDeadFunctions(CallGraph &CG,
}
if (!DeadFunctionsInComdats.empty()) {
// Filter out the functions whose comdats remain alive.
filterDeadComdatFunctions(CG.getModule(), DeadFunctionsInComdats);
filterDeadComdatFunctions(DeadFunctionsInComdats);
// Remove the rest.
for (Function *F : DeadFunctionsInComdats)
RemoveCGN(CG[F]);

View File

@ -20,8 +20,7 @@ using namespace llvm;
bool CallGraphUpdater::finalize() {
if (!DeadFunctionsInComdats.empty()) {
filterDeadComdatFunctions(*DeadFunctionsInComdats.front()->getParent(),
DeadFunctionsInComdats);
filterDeadComdatFunctions(DeadFunctionsInComdats);
DeadFunctions.append(DeadFunctionsInComdats.begin(),
DeadFunctionsInComdats.end());
}

View File

@ -178,7 +178,7 @@ llvm::getOrCreateSanitizerCtorAndInitFunctions(
}
void llvm::filterDeadComdatFunctions(
Module &M, SmallVectorImpl<Function *> &DeadComdatFunctions) {
SmallVectorImpl<Function *> &DeadComdatFunctions) {
SmallPtrSet<Function *, 32> MaybeDeadFunctions;
SmallPtrSet<Comdat *, 32> MaybeDeadComdats;
for (Function *F : DeadComdatFunctions) {