summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp2
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp2
-rw-r--r--lib/Transforms/IPO/IndMemRemoval.cpp2
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp2
-rw-r--r--lib/Transforms/IPO/Inliner.cpp2
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp1
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp4
7 files changed, 5 insertions, 10 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 79f21b5c02..646f5b8e08 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/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/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index bc5aecd76a..6cdd530a11 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/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/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp
index 78b6ea53e3..ef27cd61a9 100644
--- a/lib/Transforms/IPO/IndMemRemoval.cpp
+++ b/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/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index c2aa4cb380..c4b033c8c1 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/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/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index ae4032bbfb..edb34be203 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/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/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index cd46718ba6..e6ff5c977a 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/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/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 157ea384b7..af117094d6 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/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;