From 529ee9750baf64662fd29e6ee4685df149a75cf9 Mon Sep 17 00:00:00 2001 From: Liren Peng Date: Wed, 22 Feb 2023 02:30:13 +0000 Subject: [PATCH] [NFC] Use single quotes for single char output during `printPipline` Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D144365 --- llvm/include/llvm/Analysis/CGSCCPassManager.h | 10 +++++----- llvm/include/llvm/IR/PassManager.h | 8 ++++---- llvm/include/llvm/Transforms/Scalar/LoopPassManager.h | 2 +- llvm/lib/Analysis/StackLifetime.cpp | 4 ++-- llvm/lib/IR/PassManager.cpp | 4 ++-- llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp | 4 ++-- llvm/lib/Transforms/IPO/Inliner.cpp | 6 +++--- llvm/lib/Transforms/IPO/LoopExtractor.cpp | 4 ++-- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 4 ++-- llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | 4 ++-- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 4 ++-- llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 4 ++-- llvm/lib/Transforms/Scalar/GVN.cpp | 4 ++-- llvm/lib/Transforms/Scalar/LICM.cpp | 8 ++++---- llvm/lib/Transforms/Scalar/LoopPassManager.cpp | 4 ++-- llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 8 ++++---- llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 4 ++-- llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 4 ++-- llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | 4 ++-- llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 4 ++-- llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 6 +++--- llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp | 4 ++-- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 4 ++-- 23 files changed, 56 insertions(+), 56 deletions(-) diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h index 9d1b331..5b914af 100644 --- a/llvm/include/llvm/Analysis/CGSCCPassManager.h +++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h @@ -159,7 +159,7 @@ struct RequireAnalysisPass MapClassName2PassName) { auto ClassName = AnalysisT::name(); auto PassName = MapClassName2PassName(ClassName); - OS << "require<" << PassName << ">"; + OS << "require<" << PassName << '>'; } }; @@ -357,7 +357,7 @@ public: function_ref MapClassName2PassName) { OS << "cgscc("; Pass->printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } static bool isRequired() { return true; } @@ -489,9 +489,9 @@ public: OS << "function"; if (EagerlyInvalidate) OS << ""; - OS << "("; + OS << '('; Pass->printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } static bool isRequired() { return true; } @@ -567,7 +567,7 @@ public: function_ref MapClassName2PassName) { OS << "devirt<" << MaxIterations << ">("; Pass->printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } private: diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 21a0af6..a9d54bd 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -489,7 +489,7 @@ public: auto *P = Passes[Idx].get(); P->printPipeline(OS, MapClassName2PassName); if (Idx + 1 < Size) - OS << ","; + OS << ','; } } @@ -1260,7 +1260,7 @@ struct RequireAnalysisPass function_ref MapClassName2PassName) { auto ClassName = AnalysisT::name(); auto PassName = MapClassName2PassName(ClassName); - OS << "require<" << PassName << ">"; + OS << "require<" << PassName << '>'; } static bool isRequired() { return true; } }; @@ -1286,7 +1286,7 @@ struct InvalidateAnalysisPass function_ref MapClassName2PassName) { auto ClassName = AnalysisT::name(); auto PassName = MapClassName2PassName(ClassName); - OS << "invalidate<" << PassName << ">"; + OS << "invalidate<" << PassName << '>'; } }; @@ -1341,7 +1341,7 @@ public: function_ref MapClassName2PassName) { OS << "repeat<" << Count << ">("; P.printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } private: diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h index b996e9e..b27df81 100644 --- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h @@ -234,7 +234,7 @@ struct RequireAnalysisPass MapClassName2PassName) { auto ClassName = AnalysisT::name(); auto PassName = MapClassName2PassName(ClassName); - OS << "require<" << PassName << ">"; + OS << "require<" << PassName << '>'; } }; diff --git a/llvm/lib/Analysis/StackLifetime.cpp b/llvm/lib/Analysis/StackLifetime.cpp index ee77e81..46e1f13 100644 --- a/llvm/lib/Analysis/StackLifetime.cpp +++ b/llvm/lib/Analysis/StackLifetime.cpp @@ -414,7 +414,7 @@ void StackLifetimePrinterPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; switch (Type) { case StackLifetime::LivenessType::May: OS << "may"; @@ -423,5 +423,5 @@ void StackLifetimePrinterPass::printPipeline( OS << "must"; break; } - OS << ">"; + OS << '>'; } diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp index ef850b8..de46749 100644 --- a/llvm/lib/IR/PassManager.cpp +++ b/llvm/lib/IR/PassManager.cpp @@ -96,9 +96,9 @@ void ModuleToFunctionPassAdaptor::printPipeline( OS << "function"; if (EagerlyInvalidate) OS << ""; - OS << "("; + OS << '('; Pass->printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } PreservedAnalyses ModuleToFunctionPassAdaptor::run(Module &M, diff --git a/llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp b/llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp index 974123f..3e71e58 100644 --- a/llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp @@ -26,7 +26,7 @@ PreservedAnalyses CoroConditionalWrapper::run(Module &M, void CoroConditionalWrapper::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { OS << "coro-cond"; - OS << "("; + OS << '('; PM.printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 5bcfc38..748a27e 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -1193,13 +1193,13 @@ void ModuleInlinerWrapperPass::printPipeline( // on Params and Mode). if (!MPM.isEmpty()) { MPM.printPipeline(OS, MapClassName2PassName); - OS << ","; + OS << ','; } OS << "cgscc("; if (MaxDevirtIterations != 0) OS << "devirt<" << MaxDevirtIterations << ">("; PM.printPipeline(OS, MapClassName2PassName); if (MaxDevirtIterations != 0) - OS << ")"; - OS << ")"; + OS << ')'; + OS << ')'; } diff --git a/llvm/lib/Transforms/IPO/LoopExtractor.cpp b/llvm/lib/Transforms/IPO/LoopExtractor.cpp index ad1927c..9a5876f 100644 --- a/llvm/lib/Transforms/IPO/LoopExtractor.cpp +++ b/llvm/lib/Transforms/IPO/LoopExtractor.cpp @@ -283,8 +283,8 @@ void LoopExtractorPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (NumLoops == 1) OS << "single"; - OS << ">"; + OS << '>'; } diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index f83dfe5..5ec45a1 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1133,10 +1133,10 @@ void AddressSanitizerPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (Options.CompileKernel) OS << "kernel"; - OS << ">"; + OS << '>'; } AddressSanitizerPass::AddressSanitizerPass( diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp index 21a763b..6a610e1 100644 --- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp @@ -438,12 +438,12 @@ void HWAddressSanitizerPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (Options.CompileKernel) OS << "kernel;"; if (Options.Recover) OS << "recover"; - OS << ">"; + OS << '>'; } void HWAddressSanitizer::createHwasanCtorComdat() { diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 9107c63..23c85ca 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -706,7 +706,7 @@ void MemorySanitizerPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (Options.Recover) OS << "recover;"; if (Options.Kernel) @@ -714,7 +714,7 @@ void MemorySanitizerPass::printPipeline( if (Options.EagerChecks) OS << "eager-checks;"; OS << "track-origins=" << Options.TrackOrigins; - OS << ">"; + OS << '>'; } /// Create a non-const global initialized with the given string. diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp index 26821c7..eaec7c0 100644 --- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp +++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp @@ -1710,10 +1710,10 @@ void EarlyCSEPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (UseMemorySSA) OS << "memssa"; - OS << ">"; + OS << '>'; } namespace { diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 4a10121..28b1f45 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -772,7 +772,7 @@ void GVNPass::printPipeline( static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (Options.AllowPRE != std::nullopt) OS << (*Options.AllowPRE ? "" : "no-") << "pre;"; if (Options.AllowLoadPRE != std::nullopt) @@ -782,7 +782,7 @@ void GVNPass::printPipeline( << "split-backedge-load-pre;"; if (Options.AllowMemDep != std::nullopt) OS << (*Options.AllowMemDep ? "" : "no-") << "memdep"; - OS << ">"; + OS << '>'; } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 2865dec..be7a625 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -293,9 +293,9 @@ void LICMPass::printPipeline( static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; OS << (Opts.AllowSpeculation ? "" : "no-") << "allowspeculation"; - OS << ">"; + OS << '>'; } PreservedAnalyses LNICMPass::run(LoopNest &LN, LoopAnalysisManager &AM, @@ -334,9 +334,9 @@ void LNICMPass::printPipeline( static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; OS << (Opts.AllowSpeculation ? "" : "no-") << "allowspeculation"; - OS << ">"; + OS << '>'; } char LegacyLICMPass::ID = 0; diff --git a/llvm/lib/Transforms/Scalar/LoopPassManager.cpp b/llvm/lib/Transforms/Scalar/LoopPassManager.cpp index c98b94b..2c8a335 100644 --- a/llvm/lib/Transforms/Scalar/LoopPassManager.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPassManager.cpp @@ -59,7 +59,7 @@ void PassManagerprintPipeline(OS, MapClassName2PassName); } if (Idx + 1 < Size) - OS << ","; + OS << ','; } } @@ -193,7 +193,7 @@ void FunctionToLoopPassAdaptor::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { OS << (UseMemorySSA ? "loop-mssa(" : "loop("); Pass->printPipeline(OS, MapClassName2PassName); - OS << ")"; + OS << ')'; } PreservedAnalyses FunctionToLoopPassAdaptor::run(Function &F, FunctionAnalysisManager &AM) { diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp index 1a6065c..deb0dc2 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp @@ -1651,7 +1651,7 @@ void LoopUnrollPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (UnrollOpts.AllowPartial != std::nullopt) OS << (*UnrollOpts.AllowPartial ? "" : "no-") << "partial;"; if (UnrollOpts.AllowPeeling != std::nullopt) @@ -1664,7 +1664,7 @@ void LoopUnrollPass::printPipeline( OS << (*UnrollOpts.AllowProfileBasedPeeling ? "" : "no-") << "profile-peeling;"; if (UnrollOpts.FullUnrollMaxCount != std::nullopt) - OS << "full-unroll-max=" << UnrollOpts.FullUnrollMaxCount << ";"; - OS << "O" << UnrollOpts.OptLevel; - OS << ">"; + OS << "full-unroll-max=" << UnrollOpts.FullUnrollMaxCount << ';'; + OS << 'O' << UnrollOpts.OptLevel; + OS << '>'; } diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp index 17594b9..400f73d 100644 --- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp +++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp @@ -2397,10 +2397,10 @@ void LowerMatrixIntrinsicsPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (Minimal) OS << "minimal"; - OS << ">"; + OS << '>'; } namespace { diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp index 62e75d9..2c8b06b 100644 --- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -428,7 +428,7 @@ void MergedLoadStoreMotionPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; OS << (Options.SplitFooterBB ? "" : "no-") << "split-footer-bb"; - OS << ">"; + OS << '>'; } diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp index 17d9fc5..fe3f82d 100644 --- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp +++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp @@ -1380,10 +1380,10 @@ void SeparateConstOffsetFromGEPPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this) ->printPipeline(OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (LowerGEP) OS << "lower-gep"; - OS << ">"; + OS << '>'; } PreservedAnalyses diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index e1c39c7..5cccc2b 100644 --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -3583,10 +3583,10 @@ void SimpleLoopUnswitchPass::printPipeline( static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; OS << (NonTrivial ? "" : "no-") << "nontrivial;"; OS << (Trivial ? "" : "no-") << "trivial"; - OS << ">"; + OS << '>'; } namespace { diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index e014f5d..ca8f3d8 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -338,8 +338,8 @@ void SimplifyCFGPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; - OS << "bonus-inst-threshold=" << Options.BonusInstThreshold << ";"; + OS << '<'; + OS << "bonus-inst-threshold=" << Options.BonusInstThreshold << ';'; OS << (Options.ForwardSwitchCondToPhi ? "" : "no-") << "forward-switch-cond;"; OS << (Options.ConvertSwitchRangeToICmp ? "" : "no-") << "switch-range-to-icmp;"; @@ -348,7 +348,7 @@ void SimplifyCFGPass::printPipeline( OS << (Options.NeedCanonicalLoop ? "" : "no-") << "keep-loops;"; OS << (Options.HoistCommonInsts ? "" : "no-") << "hoist-common-insts;"; OS << (Options.SinkCommonInsts ? "" : "no-") << "sink-common-insts"; - OS << ">"; + OS << '>'; } PreservedAnalyses SimplifyCFGPass::run(Function &F, diff --git a/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp b/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp index 80dbf0f8..35d4d02 100644 --- a/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp +++ b/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp @@ -145,8 +145,8 @@ void llvm::EntryExitInstrumenterPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this) ->printPipeline(OS, MapClassName2PassName); - OS << "<"; + OS << '<'; if (PostInlining) OS << "post-inline"; - OS << ">"; + OS << '>'; } diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 7f4f907..8c9cfff 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -10634,8 +10634,8 @@ void LoopVectorizePass::printPipeline( static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - OS << "<"; + OS << '<'; OS << (InterleaveOnlyWhenForced ? "" : "no-") << "interleave-forced-only;"; OS << (VectorizeOnlyWhenForced ? "" : "no-") << "vectorize-forced-only;"; - OS << ">"; + OS << '>'; } -- 2.7.4