From c42c5243a1b83f40f50e72d2eec747f995889fba Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Feb 2010 20:42:37 +0000 Subject: [PATCH] Use an AssemblyAnnotatorWriter to clean up IVUsers' debug output. The "uses=" comments are just clutter in this context. llvm-svn: 95799 --- llvm/lib/Analysis/IVUsers.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Analysis/IVUsers.cpp b/llvm/lib/Analysis/IVUsers.cpp index 9c472ae73bc1..d3dcab0052b6 100644 --- a/llvm/lib/Analysis/IVUsers.cpp +++ b/llvm/lib/Analysis/IVUsers.cpp @@ -21,6 +21,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" +#include "llvm/Assembly/AsmAnnotationWriter.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -340,6 +341,13 @@ const SCEV *IVUsers::getCanonicalExpr(const IVStrideUse &U) const { return RetVal; } +namespace { + +// Suppress extraneous comments. +class IVUsersAsmAnnotator : public AssemblyAnnotationWriter {}; + +} + void IVUsers::print(raw_ostream &OS, const Module *M) const { OS << "IV Users for loop "; WriteAsOperand(OS, L->getHeader(), false); @@ -349,6 +357,7 @@ void IVUsers::print(raw_ostream &OS, const Module *M) const { } OS << ":\n"; + IVUsersAsmAnnotator Annotator; for (unsigned Stride = 0, e = StrideOrder.size(); Stride != e; ++Stride) { std::map::const_iterator SI = IVUsesByStride.find(StrideOrder[Stride]); @@ -364,7 +373,7 @@ void IVUsers::print(raw_ostream &OS, const Module *M) const { if (UI->isUseOfPostIncrementedValue()) OS << " (post-inc)"; OS << " in "; - UI->getUser()->print(OS); + UI->getUser()->print(OS, &Annotator); OS << '\n'; } }