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 | 67f5fcac4b64d598acf94103b6fadcfd8d7538af (patch) | |
tree | 867f4ca7cd0d6591beb04d55c32c255c938d630d /lib | |
parent | a70510a1c6e4262c9d1428921bf50685b8033450 (diff) | |
download | llvm-67f5fcac4b64d598acf94103b6fadcfd8d7538af.tar.gz llvm-67f5fcac4b64d598acf94103b6fadcfd8d7538af.tar.bz2 llvm-67f5fcac4b64d598acf94103b6fadcfd8d7538af.tar.xz |
BranchProb: Simplify printing code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/BranchProbability.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/Support/BranchProbability.cpp b/lib/Support/BranchProbability.cpp index 9485241707..65878d6e30 100644 --- a/lib/Support/BranchProbability.cpp +++ b/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; -} |