summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-11-02 20:25:50 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-11-02 20:25:50 +0000
commitde46e48420b56dd4e3a3a224eae42256e3c54c04 (patch)
tree6c55bad4d3ef2dc09e3c8627776d6613e25d7300 /llvm/lib/Analysis
parent936d546ecac680597d9acee5bfc5873624791934 (diff)
downloadbcm5719-llvm-de46e48420b56dd4e3a3a224eae42256e3c54c04.tar.gz
bcm5719-llvm-de46e48420b56dd4e3a3a224eae42256e3c54c04.zip
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. llvm-svn: 31380
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp9
-rw-r--r--llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp2
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/Andersens.cpp1
5 files changed, 6 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 8d4cbdb93d7..d9747292897 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -399,7 +399,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
}
if (V1Size != ~0U && V2Size != ~0U)
- if (const User *GEP = isGEP(V1)) {
+ if (isGEP(V1)) {
std::vector<Value*> GEPOperands;
const Value *BasePtr = GetGEPOperands(V1, GEPOperands);
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 8acbe8e26b8..169cd659e5d 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/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/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
index 9126ef98146..e28f4210b0d 100644
--- a/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
+++ b/llvm/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/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index f0bb22c3bc9..d9e171bea41 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/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();
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp
index bb3f25427c8..de6cb5a6b21 100644
--- a/llvm/lib/Analysis/IPA/Andersens.cpp
+++ b/llvm/lib/Analysis/IPA/Andersens.cpp
@@ -374,7 +374,6 @@ Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
if (Function *F = CS.getCalledFunction())
if (F->isExternal()) {
Node *N1 = getNode(P);
- bool PointsToUniversalSet = false;
if (N1->begin() == N1->end())
return NoModRef; // P doesn't point to anything.
OpenPOWER on IntegriCloud