X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FScalar%2FADCE.cpp;h=e2e9e86216cde540bbc4536f86660ad47cb47857;hb=0006bd75201f340b95c1dbf71e50dc5de5ed9425;hp=15b71fdf55ff7310aab707c3d195ab8339f302bd;hpb=a69fd903585a665c031d5aa3fdfb8dc919b44bef;p=oota-llvm.git diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 15b71fdf55f..e2e9e86216c 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -17,16 +17,14 @@ #include "llvm/Support/CFG.h" #include "Support/STLExtras.h" #include "Support/DepthFirstIterator.h" -#include "Support/StatisticReporter.h" +#include "Support/Statistic.h" #include -#include using std::cerr; using std::vector; -static Statistic<> NumBlockRemoved("adce\t\t- Number of basic blocks removed"); -static Statistic<> NumInstRemoved ("adce\t\t- Number of instructions removed"); - namespace { + Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed"); + Statistic<> NumInstRemoved ("adce", "Number of instructions removed"); //===----------------------------------------------------------------------===// // ADCE Class @@ -353,9 +351,8 @@ bool ADCE::doADCE() { // Delete the old terminator instruction... BB->getInstList().pop_back(); const Type *RetTy = Func->getReturnType(); - Instruction *New = new ReturnInst(RetTy != Type::VoidTy ? - Constant::getNullValue(RetTy) : 0); - BB->getInstList().push_back(New); + BB->getInstList().push_back(new ReturnInst(RetTy != Type::VoidTy ? + Constant::getNullValue(RetTy) : 0)); } BB->dropAllReferences();