assert(0) -> LLVM_UNREACHABLE.
[oota-llvm.git] / lib / Transforms / Scalar / BasicBlockPlacement.cpp
index 492fba2bb438b5d20934b99bf8b9dbcf94260e4e..fb9b88005b6a8d712ac8e7b82d7d7f594b2709af 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "block-placement"
 #include "llvm/Analysis/ProfileInfo.h"
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Transforms/Scalar.h"
 #include <set>
 using namespace llvm;
 
+STATISTIC(NumMoved, "Number of basic blocks moved");
+
 namespace {
-  Statistic<> NumMoved("block-placement", "Number of basic blocks moved");
+  struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass {
+    static char ID; // Pass identification, replacement for typeid
+    BlockPlacement() : FunctionPass(&ID) {}
 
-  struct BlockPlacement : public FunctionPass {
     virtual bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -67,11 +72,12 @@ namespace {
     /// successors.
     void PlaceBlocks(BasicBlock *BB);
   };
-
-  RegisterPass<BlockPlacement> X("block-placement",
-                                 "Profile Guided Basic Block Placement");
 }
 
+char BlockPlacement::ID = 0;
+static RegisterPass<BlockPlacement>
+X("block-placement", "Profile Guided Basic Block Placement");
+
 FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); }
 
 bool BlockPlacement::runOnFunction(Function &F) {