[llvm] 871affc - [Analysis] Use ListSeparator (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 22 20:17:39 PST 2021
Author: Kazu Hirata
Date: 2021-02-22T20:17:15-08:00
New Revision: 871affc5e779b6004d8fe8071a3b1a353c5ca8a0
URL: https://github.com/llvm/llvm-project/commit/871affc5e779b6004d8fe8071a3b1a353c5ca8a0
DIFF: https://github.com/llvm/llvm-project/commit/871affc5e779b6004d8fe8071a3b1a353c5ca8a0.diff
LOG: [Analysis] Use ListSeparator (NFC)
Added:
Modified:
llvm/lib/Analysis/CallGraphSCCPass.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index 38057d44e2b8..9e5049593a91 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -454,10 +454,10 @@ bool CGPassManager::RunAllPassesOnSCC(CallGraphSCC &CurSCC, CallGraph &CG,
std::string Functions;
#ifndef NDEBUG
raw_string_ostream OS(Functions);
- for (CallGraphSCC::iterator I = CurSCC.begin(), E = CurSCC.end();
- I != E; ++I) {
- if (I != CurSCC.begin()) OS << ", ";
- (*I)->print(OS);
+ ListSeparator LS;
+ for (const CallGraphNode *CGN : CurSCC) {
+ OS << LS;
+ CGN->print(OS);
}
OS.flush();
#endif
@@ -734,12 +734,9 @@ Pass *CallGraphSCCPass::createPrinterPass(raw_ostream &OS,
static std::string getDescription(const CallGraphSCC &SCC) {
std::string Desc = "SCC (";
- bool First = true;
+ ListSeparator LS;
for (CallGraphNode *CGN : SCC) {
- if (First)
- First = false;
- else
- Desc += ", ";
+ Desc += LS;
Function *F = CGN->getFunction();
if (F)
Desc += F->getName();
More information about the llvm-commits
mailing list