diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-29 17:07:42 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-29 17:07:42 +0000 |
commit | bdc1e2abdb5849f4357b47091c9dcaf0b3f8f9ae (patch) | |
tree | c49d96b9f7464f1f1be4b544f20f957d085b9ab1 /llvm/lib/Support/BranchProbability.cpp | |
parent | 690e4d493e0a80273a01d1693cc456f6f8167436 (diff) | |
download | bcm5719-llvm-bdc1e2abdb5849f4357b47091c9dcaf0b3f8f9ae.tar.gz bcm5719-llvm-bdc1e2abdb5849f4357b47091c9dcaf0b3f8f9ae.zip |
BranchProb: Simplify printing code
llvm-svn: 207559
Diffstat (limited to 'llvm/lib/Support/BranchProbability.cpp')
-rw-r--r-- | llvm/lib/Support/BranchProbability.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/Support/BranchProbability.cpp b/llvm/lib/Support/BranchProbability.cpp index 9485241707e..65878d6e302 100644 --- a/llvm/lib/Support/BranchProbability.cpp +++ b/llvm/lib/Support/BranchProbability.cpp @@ -18,13 +18,12 @@ using namespace llvm; -void BranchProbability::print(raw_ostream &OS) const { - OS << N << " / " << D << " = " << format("%g%%", ((double)N / D) * 100.0); +raw_ostream &BranchProbability::print(raw_ostream &OS) const { + return OS << N << " / " << D << " = " + << format("%g%%", ((double)N / D) * 100.0); } -void BranchProbability::dump() const { - dbgs() << *this << '\n'; -} +void BranchProbability::dump() const { print(dbgs()) << '\n'; } static uint64_t scale(uint64_t Num, uint32_t N, uint32_t D) { assert(D && "divide by 0"); @@ -72,8 +71,3 @@ uint64_t BranchProbability::scale(uint64_t Num) const { uint64_t BranchProbability::scaleByInverse(uint64_t Num) const { return ::scale(Num, D, N); } - -raw_ostream &llvm::operator<<(raw_ostream &OS, const BranchProbability &Prob) { - Prob.print(OS); - return OS; -} |