diff --git a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h --- a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h +++ b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h @@ -654,12 +654,6 @@ IRSimilarityIdentifier() : Mapper(&InstDataAllocator, &InstDataListAllocator) {} - /// \param M the module to find similarity in. - explicit IRSimilarityIdentifier(Module &M) - : Mapper(&InstDataAllocator, &InstDataListAllocator) { - findSimilarity(M); - } - private: /// Map the instructions in the module to unsigned integers, using mapping /// already present in the Mapper if possible. diff --git a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp --- a/llvm/lib/Analysis/IRSimilarityIdentifier.cpp +++ b/llvm/lib/Analysis/IRSimilarityIdentifier.cpp @@ -891,7 +891,7 @@ } bool IRSimilarityIdentifierWrapperPass::doInitialization(Module &M) { - IRSI.reset(new IRSimilarityIdentifier(M)); + IRSI.reset(new IRSimilarityIdentifier()); return false; } @@ -901,8 +901,7 @@ } bool IRSimilarityIdentifierWrapperPass::runOnModule(Module &M) { - // All the real work is done in the constructor for the pass. - IRSI.reset(new IRSimilarityIdentifier(M)); + IRSI->findSimilarity(M); return false; } @@ -910,7 +909,9 @@ IRSimilarityIdentifier IRSimilarityAnalysis::run(Module &M, ModuleAnalysisManager &) { - return IRSimilarityIdentifier(M); + auto IRSI = IRSimilarityIdentifier(); + IRSI.findSimilarity(M); + return IRSI; } PreservedAnalyses