Changes in directory llvm/lib/Analysis/DataStructure:

DataStructure.cpp updated: 1.247 -> 1.248
EquivClassGraphs.cpp updated: 1.48 -> 1.49
Local.cpp updated: 1.156 -> 1.157
---
Log message:

For PR786: http://llvm.org/PR786 :
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining 
issues when they see them. All changes pass DejaGnu tests and Olden.


---
Diffs of the changes:  (+5 -8)

 DataStructure.cpp    |    9 ++++-----
 EquivClassGraphs.cpp |    2 --
 Local.cpp            |    2 +-
 3 files changed, 5 insertions(+), 8 deletions(-)


Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.247 
llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.248
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.247     Mon Jun 19 
10:42:47 2006
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp   Thu Nov  2 14:25:49 2006
@@ -512,7 +512,6 @@
       // try merge with NewTy: struct {t1, t2, stuff...} if offset lands 
exactly on a field in Ty
       if (isa<StructType>(NewTy) && isa<StructType>(Ty)) {
         DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << 
Offset << "\n");
-        unsigned O = 0;
         const StructType *STy = cast<StructType>(Ty);
         const StructLayout &SL = *TD.getStructLayout(STy);
         unsigned i = SL.getElementContainingOffset(Offset);
@@ -537,7 +536,6 @@
       //try merge with NewTy: struct : {t1, t2, T} if offset lands on a field 
in Ty
       if (isa<StructType>(Ty)) {
         DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << 
Offset << "\n");
-        unsigned O = 0;
         const StructType *STy = cast<StructType>(Ty);
         const StructLayout &SL = *TD.getStructLayout(STy);
         unsigned i = SL.getElementContainingOffset(Offset);
@@ -1280,9 +1278,9 @@
 
   if (GlobalValue *GV = dyn_cast<GlobalValue>(Ptr)) {
     N->addGlobal(GV);
-  } else if (MallocInst *MI = dyn_cast<MallocInst>(Ptr)) {
+  } else if (isa<MallocInst>(Ptr)) {
     N->setHeapNodeMarker();
-  } else if (AllocaInst *AI = dyn_cast<AllocaInst>(Ptr)) {
+  } else if (isa<AllocaInst>(Ptr)) {
     N->setAllocaNodeMarker();
   } else {
     assert(0 && "Illegal memory object input!");
@@ -1777,8 +1775,10 @@
 
   // Scan the call list cleaning it up as necessary...
   DSNodeHandle LastCalleeNode;
+#if 0
   Function *LastCalleeFunc = 0;
   unsigned NumDuplicateCalls = 0;
+#endif
   bool LastCalleeContainsExternalFunction = false;
 
   unsigned NumDeleted = 0;
@@ -2187,7 +2187,6 @@
   } while (Iterate);
 
   // Move dead aux function calls to the end of the list
-  unsigned CurIdx = 0;
   for (std::list<DSCallSite>::iterator CI = AuxFunctionCalls.begin(),
          E = AuxFunctionCalls.end(); CI != E; )
     if (AuxFCallsAlive.count(&*CI))


Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.48 
llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.49
--- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.48   Sun Aug 27 
17:30:17 2006
+++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp        Thu Nov  2 
14:25:49 2006
@@ -256,8 +256,6 @@
 
     for (++SI; SI != FuncECs.member_end(); ++SI) {
       Function *F = *SI;
-      DSGraph *&FG = DSInfo[F];
-
       DSGraph &CBUGraph = CBU->getDSGraph(*F);
       if (GraphsMerged.insert(&CBUGraph).second) {
         // Record the "folded" graph for the function.


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.156 
llvm/lib/Analysis/DataStructure/Local.cpp:1.157
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.156     Mon Oct 23 09:39:22 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp   Thu Nov  2 14:25:49 2006
@@ -409,7 +409,7 @@
       unsigned FieldNo =
            (unsigned)cast<ConstantInt>(I.getOperand())->getZExtValue();
       Offset += (unsigned)TD.getStructLayout(STy)->MemberOffsets[FieldNo];
-    } else if (const PointerType *PTy = dyn_cast<PointerType>(*I)) {
+    } else if (isa<PointerType>(*I)) {
       if (!isa<Constant>(I.getOperand()) ||
           !cast<Constant>(I.getOperand())->isNullValue())
         Value.getNode()->setArrayMarker();



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to