Skip to content

Commit

Permalink
[SandboxVectorizer] Fix SeedContainer::[dump|print] to the preferred …
Browse files Browse the repository at this point in the history
…approach
  • Loading branch information
Sterling-Augustine committed Oct 16, 2024
1 parent fb858b4 commit cb4f8fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ class SeedContainer {
unsigned size() const { return Bundles.size(); }

#ifndef NDEBUG
void print(raw_ostream &OS) const;
LLVM_DUMP_METHOD void dump() const;
#endif // NDEBUG
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,23 @@ template void SeedContainer::insert<LoadInst>(LoadInst *);
template void SeedContainer::insert<StoreInst>(StoreInst *);

#ifndef NDEBUG
void SeedContainer::dump() const {
void SeedContainer::print(raw_ostream &OS) const {
for (const auto &Pair : Bundles) {
auto [I, Ty, Opc] = Pair.first;
const auto &SeedsVec = Pair.second;
std::string RefType = dyn_cast<LoadInst>(I) ? "Load"
: dyn_cast<StoreInst>(I) ? "Store"
: "Other";
dbgs() << "[Inst=" << *I << " Ty=" << Ty << " " << RefType << "]\n";
OS << "[Inst=" << *I << " Ty=" << Ty << " " << RefType << "]\n";
for (const auto &SeedPtr : SeedsVec) {
SeedPtr->dump(dbgs());
dbgs() << "\n";
SeedPtr->dump(OS);
OS << "\n";
}
}
dbgs() << "\n";
OS << "\n";
}

LLVM_DUMP_METHOD void SeedContainer::dump() const { print(dbgs()); }
#endif // NDEBUG

} // namespace llvm::sandboxir

0 comments on commit cb4f8fc

Please sign in to comment.