[IR] Use llvm::interleaved (NFC) (#137482)

This commit is contained in:
Kazu Hirata
2025-04-26 18:18:27 -07:00
committed by GitHub
parent 8210cdd764
commit 654c00aaf3
2 changed files with 4 additions and 21 deletions

View File

@@ -28,6 +28,7 @@
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/InterleavedRange.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/ScaledNumber.h"
#include "llvm/Support/StringSaver.h"
@@ -342,22 +343,8 @@ struct CallsiteInfo {
inline raw_ostream &operator<<(raw_ostream &OS, const CallsiteInfo &SNI) {
OS << "Callee: " << SNI.Callee;
bool First = true;
OS << " Clones: ";
for (auto V : SNI.Clones) {
if (!First)
OS << ", ";
First = false;
OS << V;
}
First = true;
OS << " StackIds: ";
for (auto Id : SNI.StackIdIndices) {
if (!First)
OS << ", ";
First = false;
OS << Id;
}
OS << " Clones: " << llvm::interleaved(SNI.Clones);
OS << " StackIds: " << llvm::interleaved(SNI.StackIdIndices);
return OS;
}

View File

@@ -4996,13 +4996,9 @@ void AssemblyWriter::printUseListOrder(const Value *V,
Out << " ";
writeOperand(V, true);
}
Out << ", { ";
assert(Shuffle.size() >= 2 && "Shuffle too small");
Out << Shuffle[0];
for (unsigned I = 1, E = Shuffle.size(); I != E; ++I)
Out << ", " << Shuffle[I];
Out << " }\n";
Out << ", { " << llvm::interleaved(Shuffle) << " }\n";
}
void AssemblyWriter::printUseLists(const Function *F) {