diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-02 20:25:50 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-02 20:25:50 +0000 |
commit | 3ed469ccd7b028a030b550d84b7336d146f5d8fa (patch) | |
tree | 66c6b892b6330e9e2eacb4a2c4e4dacf078ee216 /tools | |
parent | ef42a01113a1ee8ef0f2c803ec05a5f20eca2854 (diff) |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 1 | ||||
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 2 | ||||
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 1 | ||||
-rw-r--r-- | tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | 1 | ||||
-rw-r--r-- | tools/llvm2cpp/CppWriter.cpp | 3 | ||||
-rw-r--r-- | tools/llvmc/CompilerDriver.cpp | 7 | ||||
-rw-r--r-- | tools/opt/opt.cpp | 5 |
7 files changed, 4 insertions, 16 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 233462fc1a..73b49be212 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -525,7 +525,6 @@ bool BugDriver::debugOptimizerCrash(const std::string &ID) { std::cout << "\n*** Debugging optimizer crash!\n"; // Reduce the list of passes which causes the optimizer to crash... - unsigned OldSize = PassesToRun.size(); if (!BugpointIsInterrupted) ReducePassList(*this).reduceList(PassesToRun); diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 3503f7b2c7..850fb83f84 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -747,7 +747,7 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, // Pass on the arguments to the real function, return its result if (F->getReturnType() == Type::VoidTy) { - CallInst *Call = new CallInst(FuncPtr, Args, "", DoCallBB); + new CallInst(FuncPtr, Args, "", DoCallBB); new ReturnInst(DoCallBB); } else { CallInst *Call = new CallInst(FuncPtr, Args, "retval", DoCallBB); diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 7f13bf2677..1e8bcec463 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -445,7 +445,6 @@ bool doExtract(std::string* ErrMsg) { if (buildPaths(false, ErrMsg)) return true; - unsigned countDown = Count; for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); I != E; ++I ) { if (Paths.empty() || diff --git a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp index 2ac78344c6..01fa5130ab 100644 --- a/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ b/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp @@ -57,7 +57,6 @@ main(int argc, char **argv) { sys::PrintStackTraceOnErrorSignal(); std::ostream* Out = &std::cout; // Default to printing to stdout... - std::istream* In = &std::cin; // Default to reading stdin std::string ErrorMessage; BytecodeAnalysis bca; diff --git a/tools/llvm2cpp/CppWriter.cpp b/tools/llvm2cpp/CppWriter.cpp index f74294fb3f..1512af66e8 100644 --- a/tools/llvm2cpp/CppWriter.cpp +++ b/tools/llvm2cpp/CppWriter.cpp @@ -383,7 +383,7 @@ CppWriter::getCppName(const Value* val) { if (const GlobalVariable* GV = dyn_cast<GlobalVariable>(val)) { name = std::string("gvar_") + getTypePrefix(GV->getType()->getElementType()); - } else if (const Function* F = dyn_cast<Function>(val)) { + } else if (isa<Function>(val)) { name = std::string("func_"); } else if (const Constant* C = dyn_cast<Constant>(val)) { name = std::string("const_") + getTypePrefix(C->getType()); @@ -536,7 +536,6 @@ CppWriter::printTypeInternal(const Type* Ty) { break; } case Type::OpaqueTyID: { - const OpaqueType* OT = cast<OpaqueType>(Ty); Out << "OpaqueType* " << typeName << " = OpaqueType::get();"; nl(Out); break; diff --git a/tools/llvmc/CompilerDriver.cpp b/tools/llvmc/CompilerDriver.cpp index 46dbd89fc9..18aab21604 100644 --- a/tools/llvmc/CompilerDriver.cpp +++ b/tools/llvmc/CompilerDriver.cpp @@ -62,13 +62,6 @@ void DumpConfigData(CompilerDriver::ConfigData* cd, const std::string& type ){ DumpAction(&cd->Linker); } -/// This specifies the passes to run for OPT_FAST_COMPILE (-O1) -/// which should reduce the volume of code and make compilation -/// faster. This is also safe on any llvm module. -static const char* DefaultFastCompileOptimizations[] = { - "-simplifycfg", "-mem2reg", "-instcombine" -}; - class CompilerDriverImpl : public CompilerDriver { /// @name Constructors /// @{ diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 0602289aa6..5a6adcd9ab 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -163,7 +163,6 @@ int main(int argc, char **argv) { // FIXME: The choice of target should be controllable on the command line. std::auto_ptr<TargetMachine> target; - TargetMachine* TM = NULL; std::string ErrorMessage; // Load the input module... @@ -233,9 +232,9 @@ int main(int argc, char **argv) { Passes.add(P); if (AnalyzeOnly) { - if (BasicBlockPass *BBP = dynamic_cast<BasicBlockPass*>(P)) + if (dynamic_cast<BasicBlockPass*>(P)) Passes.add(new BasicBlockPassPrinter(PassInf)); - else if (FunctionPass *FP = dynamic_cast<FunctionPass*>(P)) + else if (dynamic_cast<FunctionPass*>(P)) Passes.add(new FunctionPassPrinter(PassInf)); else Passes.add(new ModulePassPrinter(PassInf)); |