* We were forgetting to pass varargs arguments through a call
[oota-llvm.git] / lib / Transforms / Scalar / DecomposeMultiDimRefs.cpp
index 2fb1346a5c859dde4584b789e0c439fb5927f720..d6aee14f2406bd918a4e9b056084714d742accc5 100644 (file)
@@ -1,4 +1,11 @@
 //===- llvm/Transforms/DecomposeMultiDimRefs.cpp - Lower array refs to 1D -===//
+// 
+//                     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.
+// 
+//===----------------------------------------------------------------------===//
 //
 // DecomposeMultiDimRefs - Convert multi-dimensional references consisting of
 // any combination of 2 or more array and structure indices into a sequence of
 #include "llvm/iOther.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Pass.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumAdded("lowerrefs\t\t- # of getelementptr instructions added");
+  Statistic<> NumAdded("lowerrefs", "# of getelementptr instructions added");
 
   struct DecomposePass : public BasicBlockPass {
     virtual bool runOnBasicBlock(BasicBlock &BB);
@@ -29,7 +36,7 @@ namespace {
 RegisterOpt<DecomposePass> X("lowerrefs", "Decompose multi-dimensional "
                              "structure/array references");
 
-Pass
+FunctionPass
 *createDecomposeMultiDimRefsPass()
 {
   return new DecomposePass();
@@ -44,7 +51,7 @@ DecomposePass::runOnBasicBlock(BasicBlock &BB)
 {
   bool changed = false;
   for (BasicBlock::iterator II = BB.begin(); II != BB.end(); )
-    if (GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(&*II++)) // pre-inc
+    if (GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(II++)) // pre-inc
       if (gep->getNumIndices() >= 2)
         changed |= DecomposeArrayRef(gep); // always modifies II
   return changed;