[llvm] 6cedffc - [MustExecute] Use ListSeparator (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 22:22:17 PST 2021
Author: Kazu Hirata
Date: 2021-01-28T22:21:16-08:00
New Revision: 6cedffc0ad8d9c48caf42b436acaa1f509925b4a
URL: https://github.com/llvm/llvm-project/commit/6cedffc0ad8d9c48caf42b436acaa1f509925b4a
DIFF: https://github.com/llvm/llvm-project/commit/6cedffc0ad8d9c48caf42b436acaa1f509925b4a.diff
LOG: [MustExecute] Use ListSeparator (NFC)
Added:
Modified:
llvm/lib/Analysis/MustExecute.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/MustExecute.cpp b/llvm/lib/Analysis/MustExecute.cpp
index 1e7626013eed..5ca72f5f3623 100644
--- a/llvm/lib/Analysis/MustExecute.cpp
+++ b/llvm/lib/Analysis/MustExecute.cpp
@@ -8,6 +8,7 @@
#include "llvm/Analysis/MustExecute.h"
#include "llvm/ADT/PostOrderIterator.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
@@ -451,13 +452,9 @@ class MustExecuteAnnotatedWriter : public AssemblyAnnotationWriter {
else
OS << " ; (mustexec in: ";
- bool first = true;
- for (const Loop *L : Loops) {
- if (!first)
- OS << ", ";
- first = false;
- OS << L->getHeader()->getName();
- }
+ ListSeparator LS;
+ for (const Loop *L : Loops)
+ OS << LS << L->getHeader()->getName();
OS << ")";
}
};
More information about the llvm-commits
mailing list