diff --git a/llvm/lib/Analysis/TFUtils.cpp b/llvm/lib/Analysis/TFUtils.cpp index 1377cac217abd6..701b654ba58a39 100644 --- a/llvm/lib/Analysis/TFUtils.cpp +++ b/llvm/lib/Analysis/TFUtils.cpp @@ -71,11 +71,9 @@ void writeTensorValues(raw_ostream &OutFile, const char *TensorData, size_t ElemCount) { OutFile << "["; const T *TypedData = reinterpret_cast(TensorData); - for (size_t I = 0; I < ElemCount; ++I) { - if (I > 0) - OutFile << ", "; - OutFile << TypedData[I]; - } + ListSeparator LS; + for (size_t I = 0; I < ElemCount; ++I) + OutFile << LS << TypedData[I]; OutFile << "]"; }