summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
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/Transforms/IPO
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/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/IndMemRemoval.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/LowerSetJmp.cpp1
-rw-r--r--llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp4
7 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 79f21b5c02b..646f5b8e08e 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -259,7 +259,6 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg) const {
// it is safe to unconditionally load the pointer. Use alias analysis to
// check to see if the pointer is guaranteed to not be modified from entry of
// the function to each of the load instructions.
- Function &F = *Arg->getParent();
// Because there could be several/many load instructions, remember which
// blocks we know to be transparent to the load.
@@ -508,7 +507,6 @@ Function *ArgPromotion::DoPromotion(Function *F,
GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->use_back());
std::vector<Value*> Operands(GEP->op_begin()+1, GEP->op_end());
- unsigned ArgNo = 0;
Function::arg_iterator TheArg = I2;
for (ScalarizeTable::iterator It = ArgIndices.begin();
*It != Operands; ++It, ++TheArg) {
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index bc5aecd76a1..6cdd530a11d 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1770,7 +1770,7 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
return false;
InstResult = RetVal;
}
- } else if (TerminatorInst *TI = dyn_cast<TerminatorInst>(CurInst)) {
+ } else if (isa<TerminatorInst>(CurInst)) {
BasicBlock *NewBB = 0;
if (BranchInst *BI = dyn_cast<BranchInst>(CurInst)) {
if (BI->isUnconditional()) {
diff --git a/llvm/lib/Transforms/IPO/IndMemRemoval.cpp b/llvm/lib/Transforms/IPO/IndMemRemoval.cpp
index 78b6ea53e30..ef27cd61a9a 100644
--- a/llvm/lib/Transforms/IPO/IndMemRemoval.cpp
+++ b/llvm/lib/Transforms/IPO/IndMemRemoval.cpp
@@ -77,7 +77,7 @@ bool IndMemRemPass::runOnModule(Module &M) {
BasicBlock* bb = new BasicBlock("entry",FN);
Instruction* c = new CastInst(FN->arg_begin(), Type::UIntTy, "c", bb);
Instruction* a = new MallocInst(Type::SByteTy, c, "m", bb);
- Instruction* R = new ReturnInst(a, bb);
+ new ReturnInst(a, bb);
++NumBounce;
NumBounceSites += F->getNumUses();
F->replaceAllUsesWith(FN);
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index c2aa4cb3809..c4b033c8c1f 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp
@@ -245,7 +245,7 @@ int SimpleInliner::getInlineCost(CallSite CS) {
// significant future optimization possibilities (like scalar promotion, and
// scalarization), so encourage the inlining of the function.
//
- else if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) {
+ else if (isa<AllocaInst>(I)) {
if (ArgNo < CalleeFI.ArgumentWeights.size())
InlineCost -= CalleeFI.ArgumentWeights[ArgNo].AllocaWeight;
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index ae4032bbfb3..edb34be203f 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -129,8 +129,6 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
DEBUG(std::cerr << " Inlining: cost=" << InlineCost
<< ", Call: " << *CS.getInstruction());
- Function *Caller = CS.getInstruction()->getParent()->getParent();
-
// Attempt to inline the function...
if (InlineCallIfPossible(CS, CG, SCCFunctions)) {
// Remove this call site from the list.
diff --git a/llvm/lib/Transforms/IPO/LowerSetJmp.cpp b/llvm/lib/Transforms/IPO/LowerSetJmp.cpp
index cd46718ba6c..e6ff5c977af 100644
--- a/llvm/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/llvm/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -496,7 +496,6 @@ void LowerSetJmp::visitInvokeInst(InvokeInst& II)
// If not reachable from a setjmp call, don't transform.
if (!DFSBlocks.count(BB)) return;
- BasicBlock* NormalBB = II.getNormalDest();
BasicBlock* ExceptBB = II.getUnwindDest();
Function* Func = BB->getParent();
diff --git a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 157ea384b78..af117094d63 100644
--- a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -1106,7 +1106,7 @@ struct LLVMMemCpyMoveOptzn : public LibCallOptimization {
CastInst* DestCast =
new CastInst(dest,PointerType::get(castType),dest->getName()+".cast",ci);
LoadInst* LI = new LoadInst(SrcCast,SrcCast->getName()+".val",ci);
- StoreInst* SI = new StoreInst(LI, DestCast, ci);
+ new StoreInst(LI, DestCast, ci);
ci->eraseFromParent();
return true;
}
@@ -2063,7 +2063,7 @@ bool getConstantStringLength(Value *V, uint64_t &len, ConstantArray **CA) {
Constant* INTLZR = GV->getInitializer();
// Handle the ConstantAggregateZero case
- if (ConstantAggregateZero *CAZ = dyn_cast<ConstantAggregateZero>(INTLZR)) {
+ if (isa<ConstantAggregateZero>(INTLZR)) {
// This is a degenerate case. The initializer is constant zero so the
// length of the string must be zero.
len = 0;
OpenPOWER on IntegriCloud