diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -51,7 +51,6 @@ void initializeAAEvalLegacyPassPass(PassRegistry&); void initializeAAResultsWrapperPassPass(PassRegistry&); void initializeADCELegacyPassPass(PassRegistry&); -void initializeAddDiscriminatorsLegacyPassPass(PassRegistry&); void initializeAlwaysInlinerLegacyPassPass(PassRegistry&); void initializeAssignmentTrackingAnalysisPass(PassRegistry &); void initializeAssumeBuilderPassLegacyPassPass(PassRegistry &); diff --git a/llvm/lib/Transforms/Utils/AddDiscriminators.cpp b/llvm/lib/Transforms/Utils/AddDiscriminators.cpp --- a/llvm/lib/Transforms/Utils/AddDiscriminators.cpp +++ b/llvm/lib/Transforms/Utils/AddDiscriminators.cpp @@ -85,28 +85,6 @@ "no-discriminators", cl::init(false), cl::desc("Disable generation of discriminator information.")); -namespace { - -// The legacy pass of AddDiscriminators. -struct AddDiscriminatorsLegacyPass : public FunctionPass { - static char ID; // Pass identification, replacement for typeid - - AddDiscriminatorsLegacyPass() : FunctionPass(ID) { - initializeAddDiscriminatorsLegacyPassPass(*PassRegistry::getPassRegistry()); - } - - bool runOnFunction(Function &F) override; -}; - -} // end anonymous namespace - -char AddDiscriminatorsLegacyPass::ID = 0; - -INITIALIZE_PASS_BEGIN(AddDiscriminatorsLegacyPass, "add-discriminators", - "Add DWARF path discriminators", false, false) -INITIALIZE_PASS_END(AddDiscriminatorsLegacyPass, "add-discriminators", - "Add DWARF path discriminators", false, false) - static bool shouldHaveDiscriminator(const Instruction *I) { return !isa(I) || isa(I); } @@ -264,10 +242,6 @@ return Changed; } -bool AddDiscriminatorsLegacyPass::runOnFunction(Function &F) { - return addDiscriminators(F); -} - PreservedAnalyses AddDiscriminatorsPass::run(Function &F, FunctionAnalysisManager &AM) { if (!addDiscriminators(F)) diff --git a/llvm/lib/Transforms/Utils/Utils.cpp b/llvm/lib/Transforms/Utils/Utils.cpp --- a/llvm/lib/Transforms/Utils/Utils.cpp +++ b/llvm/lib/Transforms/Utils/Utils.cpp @@ -21,7 +21,6 @@ /// initializeTransformUtils - Initialize all passes in the TransformUtils /// library. void llvm::initializeTransformUtils(PassRegistry &Registry) { - initializeAddDiscriminatorsLegacyPassPass(Registry); initializeAssumeBuilderPassLegacyPassPass(Registry); initializeBreakCriticalEdgesPass(Registry); initializeCanonicalizeFreezeInLoopsPass(Registry);