From 657f5b974308030c70c58c823d2a7a52fc9c2fd4 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 26 Jan 2021 20:00:17 -0800 Subject: [PATCH] [MemorySSA] Use ListSeparator (NFC) --- llvm/lib/Analysis/MemorySSA.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index 52dca7d..57f1dcc 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -21,6 +21,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -2197,17 +2198,13 @@ void MemoryDef::print(raw_ostream &OS) const { } void MemoryPhi::print(raw_ostream &OS) const { - bool First = true; + ListSeparator LS(","); OS << getID() << " = MemoryPhi("; for (const auto &Op : operands()) { BasicBlock *BB = getIncomingBlock(Op); MemoryAccess *MA = cast(Op); - if (!First) - OS << ','; - else - First = false; - OS << '{'; + OS << LS << '{'; if (BB->hasName()) OS << BB->getName(); else -- 2.7.4