LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BranchProbability.cpp
Go to the documentation of this file.
1 //===-------------- lib/Support/BranchProbability.cpp -----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements Branch Probability class.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "llvm/Support/Debug.h"
16 #include "llvm/Support/Format.h"
18 
19 using namespace llvm;
20 
22  OS << N << " / " << D << " = " << format("%g%%", ((double)N / D) * 100.0);
23 }
24 
26  dbgs() << *this << '\n';
27 }
28 
29 namespace llvm {
30 
32  Prob.print(OS);
33  return OS;
34 }
35 
36 }
format_object1< T > format(const char *Fmt, const T &Val)
Definition: Format.h:180
void print(raw_ostream &OS) const
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
Definition: Debug.cpp:101
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Definition: APInt.h:1688