From 3ed469ccd7b028a030b550d84b7336d146f5d8fa Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 2 Nov 2006 20:25:50 +0000 Subject: For 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/DataStructure.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/Analysis/DataStructure/DataStructure.cpp') diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index 8acbe8e26b..169cd659e5 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -512,7 +512,6 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset, // try merge with NewTy: struct {t1, t2, stuff...} if offset lands exactly on a field in Ty if (isa(NewTy) && isa(Ty)) { DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n"); - unsigned O = 0; const StructType *STy = cast(Ty); const StructLayout &SL = *TD.getStructLayout(STy); unsigned i = SL.getElementContainingOffset(Offset); @@ -537,7 +536,6 @@ bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset, //try merge with NewTy: struct : {t1, t2, T} if offset lands on a field in Ty if (isa(Ty)) { DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n"); - unsigned O = 0; const StructType *STy = cast(Ty); const StructLayout &SL = *TD.getStructLayout(STy); unsigned i = SL.getElementContainingOffset(Offset); @@ -1280,9 +1278,9 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) { if (GlobalValue *GV = dyn_cast(Ptr)) { N->addGlobal(GV); - } else if (MallocInst *MI = dyn_cast(Ptr)) { + } else if (isa(Ptr)) { N->setHeapNodeMarker(); - } else if (AllocaInst *AI = dyn_cast(Ptr)) { + } else if (isa(Ptr)) { N->setAllocaNodeMarker(); } else { assert(0 && "Illegal memory object input!"); @@ -1777,8 +1775,10 @@ static void removeIdenticalCalls(std::list &Calls) { // 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 @@ void DSGraph::removeDeadNodes(unsigned Flags) { } while (Iterate); // Move dead aux function calls to the end of the list - unsigned CurIdx = 0; for (std::list::iterator CI = AuxFunctionCalls.begin(), E = AuxFunctionCalls.end(); CI != E; ) if (AuxFCallsAlive.count(&*CI)) -- cgit v1.2.3-18-g5258