[llvm-commits] [llvm] r136221 - in /llvm/trunk: include/llvm/Support/BlockFrequency.h lib/Support/BlockFrequency.cpp
Jakub Staszak
jstaszak at apple.com
Wed Jul 27 08:51:51 PDT 2011
Author: kuba
Date: Wed Jul 27 10:51:51 2011
New Revision: 136221
URL: http://llvm.org/viewvc/llvm-project?rev=136221&view=rev
Log:
Move static methods to the anonymous namespace.
Modified:
llvm/trunk/include/llvm/Support/BlockFrequency.h
llvm/trunk/lib/Support/BlockFrequency.cpp
Modified: llvm/trunk/include/llvm/Support/BlockFrequency.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/BlockFrequency.h?rev=136221&r1=136220&r2=136221&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/BlockFrequency.h (original)
+++ llvm/trunk/include/llvm/Support/BlockFrequency.h Wed Jul 27 10:51:51 2011
@@ -24,9 +24,6 @@
uint64_t Frequency;
- static void mult96bit(uint64_t freq, uint32_t N, uint64_t W[2]);
- static uint64_t div96bit(uint64_t W[2], uint32_t D);
-
public:
BlockFrequency(uint64_t Freq = 0) : Frequency(Freq) { }
Modified: llvm/trunk/lib/Support/BlockFrequency.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/BlockFrequency.cpp?rev=136221&r1=136220&r2=136221&view=diff
==============================================================================
--- llvm/trunk/lib/Support/BlockFrequency.cpp (original)
+++ llvm/trunk/lib/Support/BlockFrequency.cpp Wed Jul 27 10:51:51 2011
@@ -18,8 +18,10 @@
using namespace llvm;
+namespace {
+
/// mult96bit - Multiply FREQ by N and store result in W array.
-void BlockFrequency::mult96bit(uint64_t freq, uint32_t N, uint64_t W[2]) {
+void mult96bit(uint64_t freq, uint32_t N, uint64_t W[2]) {
uint64_t u0 = freq & UINT32_MAX;
uint64_t u1 = freq >> 32;
@@ -41,7 +43,7 @@
/// div96bit - Divide 96-bit value stored in W array by D. Return 64-bit frequency.
-uint64_t BlockFrequency::div96bit(uint64_t W[2], uint32_t D) {
+uint64_t div96bit(uint64_t W[2], uint32_t D) {
uint64_t y = W[0];
uint64_t x = W[1];
@@ -58,6 +60,9 @@
return y;
}
+}
+
+
BlockFrequency &BlockFrequency::operator*=(const BranchProbability &Prob) {
uint32_t n = Prob.getNumerator();
uint32_t d = Prob.getDenominator();
More information about the llvm-commits
mailing list