mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-03 13:51:39 +00:00
Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
20638dc948
commit
44d98a76dc
@ -26,6 +26,7 @@
|
|||||||
#include "llvm/Analysis/AliasAnalysis.h"
|
#include "llvm/Analysis/AliasAnalysis.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/InstIterator.h"
|
#include "llvm/Support/InstIterator.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
@ -91,7 +92,7 @@ static void PrintResults(const char *Msg, bool P, const Value *V1,
|
|||||||
|
|
||||||
if (o2 < o1)
|
if (o2 < o1)
|
||||||
std::swap(o1, o2);
|
std::swap(o1, o2);
|
||||||
errs() << " " << Msg << ":\t"
|
dbgs() << " " << Msg << ":\t"
|
||||||
<< o1 << ", "
|
<< o1 << ", "
|
||||||
<< o2 << "\n";
|
<< o2 << "\n";
|
||||||
}
|
}
|
||||||
@ -101,9 +102,9 @@ static inline void
|
|||||||
PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
|
PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
|
||||||
Module *M) {
|
Module *M) {
|
||||||
if (P) {
|
if (P) {
|
||||||
errs() << " " << Msg << ": Ptr: ";
|
dbgs() << " " << Msg << ": Ptr: ";
|
||||||
WriteAsOperand(errs(), Ptr, true, M);
|
WriteAsOperand(dbgs(), Ptr, true, M);
|
||||||
errs() << "\t<->" << *I << '\n';
|
dbgs() << "\t<->" << *I << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
if (PrintNoAlias || PrintMayAlias || PrintMustAlias ||
|
if (PrintNoAlias || PrintMayAlias || PrintMustAlias ||
|
||||||
PrintNoModRef || PrintMod || PrintRef || PrintModRef)
|
PrintNoModRef || PrintMod || PrintRef || PrintModRef)
|
||||||
errs() << "Function: " << F.getName() << ": " << Pointers.size()
|
dbgs() << "Function: " << F.getName() << ": " << Pointers.size()
|
||||||
<< " pointers, " << CallSites.size() << " call sites\n";
|
<< " pointers, " << CallSites.size() << " call sites\n";
|
||||||
|
|
||||||
// iterate over the worklist, and run the full (n^2)/2 disambiguations
|
// iterate over the worklist, and run the full (n^2)/2 disambiguations
|
||||||
@ -161,7 +162,7 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
|
PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
|
||||||
++MustAlias; break;
|
++MustAlias; break;
|
||||||
default:
|
default:
|
||||||
errs() << "Unknown alias query result!\n";
|
dbgs() << "Unknown alias query result!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,7 +192,7 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent());
|
PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent());
|
||||||
++ModRef; break;
|
++ModRef; break;
|
||||||
default:
|
default:
|
||||||
errs() << "Unknown alias query result!\n";
|
dbgs() << "Unknown alias query result!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,24 +201,24 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void PrintPercent(unsigned Num, unsigned Sum) {
|
static void PrintPercent(unsigned Num, unsigned Sum) {
|
||||||
errs() << "(" << Num*100ULL/Sum << "."
|
dbgs() << "(" << Num*100ULL/Sum << "."
|
||||||
<< ((Num*1000ULL/Sum) % 10) << "%)\n";
|
<< ((Num*1000ULL/Sum) % 10) << "%)\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AAEval::doFinalization(Module &M) {
|
bool AAEval::doFinalization(Module &M) {
|
||||||
unsigned AliasSum = NoAlias + MayAlias + MustAlias;
|
unsigned AliasSum = NoAlias + MayAlias + MustAlias;
|
||||||
errs() << "===== Alias Analysis Evaluator Report =====\n";
|
dbgs() << "===== Alias Analysis Evaluator Report =====\n";
|
||||||
if (AliasSum == 0) {
|
if (AliasSum == 0) {
|
||||||
errs() << " Alias Analysis Evaluator Summary: No pointers!\n";
|
dbgs() << " Alias Analysis Evaluator Summary: No pointers!\n";
|
||||||
} else {
|
} else {
|
||||||
errs() << " " << AliasSum << " Total Alias Queries Performed\n";
|
dbgs() << " " << AliasSum << " Total Alias Queries Performed\n";
|
||||||
errs() << " " << NoAlias << " no alias responses ";
|
dbgs() << " " << NoAlias << " no alias responses ";
|
||||||
PrintPercent(NoAlias, AliasSum);
|
PrintPercent(NoAlias, AliasSum);
|
||||||
errs() << " " << MayAlias << " may alias responses ";
|
dbgs() << " " << MayAlias << " may alias responses ";
|
||||||
PrintPercent(MayAlias, AliasSum);
|
PrintPercent(MayAlias, AliasSum);
|
||||||
errs() << " " << MustAlias << " must alias responses ";
|
dbgs() << " " << MustAlias << " must alias responses ";
|
||||||
PrintPercent(MustAlias, AliasSum);
|
PrintPercent(MustAlias, AliasSum);
|
||||||
errs() << " Alias Analysis Evaluator Pointer Alias Summary: "
|
dbgs() << " Alias Analysis Evaluator Pointer Alias Summary: "
|
||||||
<< NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
|
<< NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
|
||||||
<< MustAlias*100/AliasSum << "%\n";
|
<< MustAlias*100/AliasSum << "%\n";
|
||||||
}
|
}
|
||||||
@ -225,18 +226,18 @@ bool AAEval::doFinalization(Module &M) {
|
|||||||
// Display the summary for mod/ref analysis
|
// Display the summary for mod/ref analysis
|
||||||
unsigned ModRefSum = NoModRef + Mod + Ref + ModRef;
|
unsigned ModRefSum = NoModRef + Mod + Ref + ModRef;
|
||||||
if (ModRefSum == 0) {
|
if (ModRefSum == 0) {
|
||||||
errs() << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n";
|
dbgs() << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n";
|
||||||
} else {
|
} else {
|
||||||
errs() << " " << ModRefSum << " Total ModRef Queries Performed\n";
|
dbgs() << " " << ModRefSum << " Total ModRef Queries Performed\n";
|
||||||
errs() << " " << NoModRef << " no mod/ref responses ";
|
dbgs() << " " << NoModRef << " no mod/ref responses ";
|
||||||
PrintPercent(NoModRef, ModRefSum);
|
PrintPercent(NoModRef, ModRefSum);
|
||||||
errs() << " " << Mod << " mod responses ";
|
dbgs() << " " << Mod << " mod responses ";
|
||||||
PrintPercent(Mod, ModRefSum);
|
PrintPercent(Mod, ModRefSum);
|
||||||
errs() << " " << Ref << " ref responses ";
|
dbgs() << " " << Ref << " ref responses ";
|
||||||
PrintPercent(Ref, ModRefSum);
|
PrintPercent(Ref, ModRefSum);
|
||||||
errs() << " " << ModRef << " mod & ref responses ";
|
dbgs() << " " << ModRef << " mod & ref responses ";
|
||||||
PrintPercent(ModRef, ModRefSum);
|
PrintPercent(ModRef, ModRefSum);
|
||||||
errs() << " Alias Analysis Evaluator Mod/Ref Summary: "
|
dbgs() << " Alias Analysis Evaluator Mod/Ref Summary: "
|
||||||
<< NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
|
<< NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
|
||||||
<< Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";
|
<< Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user