diff --git a/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/include/llvm/Analysis/BlockFrequencyInfoImpl.h index c434b539561..ba69c7ae3fe 100644 --- a/include/llvm/Analysis/BlockFrequencyInfoImpl.h +++ b/include/llvm/Analysis/BlockFrequencyInfoImpl.h @@ -31,15 +31,26 @@ #define DEBUG_TYPE "block-freq" -//===----------------------------------------------------------------------===// -// -// BlockMass definition. -// -// TODO: Make this private to BlockFrequencyInfoImpl or delete. -// -//===----------------------------------------------------------------------===// namespace llvm { +class BasicBlock; +class BranchProbabilityInfo; +class Function; +class Loop; +class LoopInfo; +class MachineBasicBlock; +class MachineBranchProbabilityInfo; +class MachineFunction; +class MachineLoop; +class MachineLoopInfo; + +namespace bfi_detail { + +struct IrreducibleGraph; + +// This is part of a workaround for a GCC 4.7 crash on lambdas. +template struct BlockEdgesAdder; + /// \brief Mass of a block. /// /// This class implements a sort of fixed-point fraction always between 0.0 and @@ -128,37 +139,12 @@ inline raw_ostream &operator<<(raw_ostream &OS, const BlockMass &X) { return X.print(OS); } -template <> struct isPodLike { +} // end namespace bfi_detail + +template <> struct isPodLike { static const bool value = true; }; -} // end namespace llvm - -//===----------------------------------------------------------------------===// -// -// BlockFrequencyInfoImpl definition. -// -//===----------------------------------------------------------------------===// -namespace llvm { - -class BasicBlock; -class BranchProbabilityInfo; -class Function; -class Loop; -class LoopInfo; -class MachineBasicBlock; -class MachineBranchProbabilityInfo; -class MachineFunction; -class MachineLoop; -class MachineLoopInfo; - -namespace bfi_detail { -struct IrreducibleGraph; - -// This is part of a workaround for a GCC 4.7 crash on lambdas. -template struct BlockEdgesAdder; -} - /// \brief Base class for BlockFrequencyInfoImpl /// /// BlockFrequencyInfoImplBase has supporting data structures and some @@ -170,6 +156,7 @@ template struct BlockEdgesAdder; class BlockFrequencyInfoImplBase { public: typedef ScaledNumber Scaled64; + typedef bfi_detail::BlockMass BlockMass; /// \brief Representative of a block. /// diff --git a/lib/Analysis/BlockFrequencyInfoImpl.cpp b/lib/Analysis/BlockFrequencyInfoImpl.cpp index 39d7f520b4e..44b4192353a 100644 --- a/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -21,11 +21,6 @@ using namespace llvm::bfi_detail; #define DEBUG_TYPE "block-freq" -//===----------------------------------------------------------------------===// -// -// BlockMass implementation. -// -//===----------------------------------------------------------------------===// ScaledNumber BlockMass::toScaled() const { if (isFull()) return ScaledNumber(1, 0); @@ -46,11 +41,6 @@ raw_ostream &BlockMass::print(raw_ostream &OS) const { return OS; } -//===----------------------------------------------------------------------===// -// -// BlockFrequencyInfoImpl implementation. -// -//===----------------------------------------------------------------------===// namespace { typedef BlockFrequencyInfoImplBase::BlockNode BlockNode;