aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorJakub Staszak <jstaszak@apple.com>2011-12-06 23:59:33 +0000
committerJakub Staszak <jstaszak@apple.com>2011-12-06 23:59:33 +0000
commite6d81ad6a572f2492885f36fc5571225e963d39d (patch)
treeee85ed97e41f060d3e4d34fab544db2bd1df9ab7 /lib/CodeGen/MachineBlockPlacement.cpp
parenta66512e59142f36ae653460891c058d5e78e07e3 (diff)
- Remove unneeded #includes.
- Remove unused types/fields. - Add some constantness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--lib/CodeGen/MachineBlockPlacement.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/lib/CodeGen/MachineBlockPlacement.cpp b/lib/CodeGen/MachineBlockPlacement.cpp
index 584290bd0f..b07ce686b4 100644
--- a/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/lib/CodeGen/MachineBlockPlacement.cpp
@@ -36,10 +36,7 @@
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/PostOrderIterator.h"
-#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
@@ -56,22 +53,6 @@ STATISTIC(UncondBranchTakenFreq,
"Potential frequency of taking unconditional branches");
namespace {
-/// \brief A structure for storing a weighted edge.
-///
-/// This stores an edge and its weight, computed as the product of the
-/// frequency that the starting block is entered with the probability of
-/// a particular exit block.
-struct WeightedEdge {
- BlockFrequency EdgeFrequency;
- MachineBasicBlock *From, *To;
-
- bool operator<(const WeightedEdge &RHS) const {
- return EdgeFrequency < RHS.EdgeFrequency;
- }
-};
-}
-
-namespace {
class BlockChain;
/// \brief Type for our function-wide basic block -> block chain mapping.
typedef DenseMap<MachineBasicBlock *, BlockChain *> BlockToChainMapType;
@@ -121,17 +102,15 @@ public:
}
/// \brief Iterator over blocks within the chain.
- typedef SmallVectorImpl<MachineBasicBlock *>::iterator iterator;
- typedef SmallVectorImpl<MachineBasicBlock *>::reverse_iterator
+ typedef SmallVectorImpl<MachineBasicBlock *>::const_iterator iterator;
+ typedef SmallVectorImpl<MachineBasicBlock *>::const_reverse_iterator
reverse_iterator;
/// \brief Beginning of blocks within the chain.
- iterator begin() { return Blocks.begin(); }
- reverse_iterator rbegin() { return Blocks.rbegin(); }
+ iterator begin() const { return Blocks.begin(); }
/// \brief End of blocks within the chain.
- iterator end() { return Blocks.end(); }
- reverse_iterator rend() { return Blocks.rend(); }
+ iterator end() const { return Blocks.end(); }
/// \brief Merge a block chain into this one.
///