[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp ProfilePaths.cpp RetracePath.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Apr 23 11:38:09 PDT 2003


Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths:

EdgeCode.cpp updated: 1.19 -> 1.20
ProfilePaths.cpp updated: 1.26 -> 1.27
RetracePath.cpp updated: 1.3 -> 1.4

---
Log message:

Remove unnecesary &*'s


---
Diffs of the changes:

Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.19 llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.20
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.19	Fri Feb 14 14:38:10 2003
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp	Wed Apr 23 11:37:41 2003
@@ -386,7 +386,7 @@
   for(BasicBlock::iterator BB2Inst = BB2->begin(), BBend = BB2->end(); 
       BB2Inst != BBend; ++BB2Inst){
    
-    if(PHINode *phiInst=dyn_cast<PHINode>(&*BB2Inst)){
+    if(PHINode *phiInst=dyn_cast<PHINode>(BB2Inst)){
       int bbIndex=phiInst->getBasicBlockIndex(BB1);
       assert(bbIndex>=0);
       phiInst->setIncomingBlock(bbIndex, newBB);


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.26 llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.27
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp:1.26	Wed Apr 16 15:28:42 2003
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp	Wed Apr 23 11:37:41 2003
@@ -87,7 +87,7 @@
     nodes.push_back(nd); 
     if(&*BB == ExitNode)
       exitNode=nd;
-    if(&*BB==F.begin())
+    if(BB==F.begin())
       startNode=nd;
   }
 


Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp:1.3 llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp:1.4
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp:1.3	Fri Feb 14 14:41:53 2003
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/RetracePath.cpp	Wed Apr 23 11:37:41 2003
@@ -140,7 +140,7 @@
     BasicBlock *ExitNode = 0;
     for (Function::iterator I = M->begin(), E = M->end(); I != E; ++I){
       if (isa<ReturnInst>(I->getTerminator())) {
-        ExitNode = &*I;
+        ExitNode = I;
         break;
       }
     }
@@ -160,7 +160,7 @@
       if(BB->size()==3 || BB->size() ==2){
         for(BasicBlock::iterator II = BB->begin(), IE = BB->end();
             II != IE; ++II){
-          if(CallInst *callInst = dyn_cast<CallInst>(&*II)){
+          if(CallInst *callInst = dyn_cast<CallInst>(II)){
             //std::cerr<<*callInst;
             Function *calledFunction = callInst->getCalledFunction();
             if(calledFunction && calledFunction->getName() == "trigger"){
@@ -199,7 +199,7 @@
         continue;
       
       //if(BB->size()==3)
-      //if(CallInst *callInst = dyn_cast<CallInst>(&*BB->getInstList().begin()))
+      //if(CallInst *callInst = dyn_cast<CallInst>(BB->getInstList().begin()))
       //if(callInst->getCalledFunction()->getName() == "trigger")
       //continue;
       
@@ -216,20 +216,20 @@
       Node *nd=findBB(nodes, BB);
       assert(nd && "No node for this edge!");
       
-      for(BasicBlock::succ_iterator s=succ_begin(&*BB), se=succ_end(&*BB); 
+      for(BasicBlock::succ_iterator s=succ_begin(BB), se=succ_end(BB); 
           s!=se; ++s){
         
         if(triggerBBs[*s] == 9){
           //if(!pathReg[M]){ //Get the path register for this!
           //if(BB->size()>8)
-          //  if(LoadInst *ldInst = dyn_cast<LoadInst>(&*BB->getInstList().begin()))
+          //  if(LoadInst *ldInst = dyn_cast<LoadInst>(BB->getInstList().begin()))
           //    pathReg[M] = ldInst->getPointerOperand();
           //}
           continue;
         }
         //if((*s)->size()==3)
         //if(CallInst *callInst = 
-        //   dyn_cast<CallInst>(&*(*s)->getInstList().begin()))
+        //   dyn_cast<CallInst>((*s)->getInstList().begin()))
         //  if(callInst->getCalledFunction()->getName() == "trigger")
         //    continue;
         
@@ -284,11 +284,11 @@
         VBI != VBE; ++VBI){
       for(BasicBlock::iterator BBI = (*VBI)->begin(), BBE = (*VBI)->end();
           BBI != BBE; ++BBI){
-        if(LoadInst *ldInst = dyn_cast<LoadInst>(&*BBI)){
+        if(LoadInst *ldInst = dyn_cast<LoadInst>(BBI)){
           if(pathReg[M] == ldInst->getPointerOperand())
             instToErase.push_back(ldInst);
         }
-        else if(StoreInst *stInst = dyn_cast<StoreInst>(&*BBI)){
+        else if(StoreInst *stInst = dyn_cast<StoreInst>(BBI)){
           if(pathReg[M] == stInst->getPointerOperand())
             instToErase.push_back(stInst);
         }





More information about the llvm-commits mailing list