diff options
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r-- | lib/Analysis/DataStructure/DataStructure.cpp | 9 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/EquivClassGraphs.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/Local.cpp | 2 |
3 files changed, 5 insertions, 8 deletions
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<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 @@ 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<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 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) { 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 @@ static void removeIdenticalCalls(std::list<DSCallSite> &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<DSCallSite>::iterator CI = AuxFunctionCalls.begin(), E = AuxFunctionCalls.end(); CI != E; ) if (AuxFCallsAlive.count(&*CI)) diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp index 9126ef9814..e28f4210b0 100644 --- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -256,8 +256,6 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) { 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. diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index f0bb22c3bc..d9e171bea4 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -409,7 +409,7 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { 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(); |