@@ -546,54 +546,8 @@ void writeThinLTOBitcode(raw_ostream &OS, raw_ostream *ThinLinkOS,
546546 writeThinLinkBitcodeToFile (M, *ThinLinkOS, *Index, ModHash);
547547}
548548
549- class WriteThinLTOBitcode : public ModulePass {
550- raw_ostream &OS; // raw_ostream to print on
551- // The output stream on which to emit a minimized module for use
552- // just in the thin link, if requested.
553- raw_ostream *ThinLinkOS = nullptr ;
554-
555- public:
556- static char ID; // Pass identification, replacement for typeid
557- WriteThinLTOBitcode () : ModulePass(ID), OS(dbgs()) {
558- initializeWriteThinLTOBitcodePass (*PassRegistry::getPassRegistry ());
559- }
560-
561- explicit WriteThinLTOBitcode (raw_ostream &o, raw_ostream *ThinLinkOS)
562- : ModulePass(ID), OS(o), ThinLinkOS(ThinLinkOS) {
563- initializeWriteThinLTOBitcodePass (*PassRegistry::getPassRegistry ());
564- }
565-
566- StringRef getPassName () const override { return " ThinLTO Bitcode Writer" ; }
567-
568- bool runOnModule (Module &M) override {
569- const ModuleSummaryIndex *Index =
570- &(getAnalysis<ModuleSummaryIndexWrapperPass>().getIndex ());
571- writeThinLTOBitcode (OS, ThinLinkOS, LegacyAARGetter (*this ), M, Index);
572- return true ;
573- }
574- void getAnalysisUsage (AnalysisUsage &AU) const override {
575- AU.setPreservesAll ();
576- AU.addRequired <AssumptionCacheTracker>();
577- AU.addRequired <ModuleSummaryIndexWrapperPass>();
578- AU.addRequired <TargetLibraryInfoWrapperPass>();
579- }
580- };
581549} // anonymous namespace
582550
583- char WriteThinLTOBitcode::ID = 0 ;
584- INITIALIZE_PASS_BEGIN (WriteThinLTOBitcode, " write-thinlto-bitcode" ,
585- " Write ThinLTO Bitcode" , false , true )
586- INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
587- INITIALIZE_PASS_DEPENDENCY(ModuleSummaryIndexWrapperPass)
588- INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
589- INITIALIZE_PASS_END(WriteThinLTOBitcode, " write-thinlto-bitcode" ,
590- " Write ThinLTO Bitcode" , false , true )
591-
592- ModulePass *llvm::createWriteThinLTOBitcodePass(raw_ostream &Str,
593- raw_ostream *ThinLinkOS) {
594- return new WriteThinLTOBitcode (Str, ThinLinkOS);
595- }
596-
597551PreservedAnalyses
598552llvm::ThinLTOBitcodeWriterPass::run (Module &M, ModuleAnalysisManager &AM) {
599553 FunctionAnalysisManager &FAM =
0 commit comments