From 250ab62a62754ed99e66f81611f0f6db6e92e0a3 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 26 Nov 2012 00:56:44 +0000 Subject: Fix gcc's -Wunused-but-set-variable warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168576 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/ExceptionDemo/ExceptionDemo.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'examples/ExceptionDemo/ExceptionDemo.cpp') diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index 215cb4d371..2d35ca73e8 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -667,8 +667,6 @@ static _Unwind_Reason_Code handleLsda(int version, const uint8_t *actionTableStart = callSiteTableEnd; const uint8_t *callSitePtr = callSiteTableStart; - bool foreignException = false; - while (callSitePtr < callSiteTableEnd) { uintptr_t start = readEncodedPointer(&callSitePtr, callSiteEncoding); @@ -684,7 +682,6 @@ static _Unwind_Reason_Code handleLsda(int version, // We have been notified of a foreign exception being thrown, // and we therefore need to execute cleanup landing pads actionEntry = 0; - foreignException = true; } if (landingPad == 0) { @@ -1687,7 +1684,6 @@ static void createStandardUtilityFunctions(unsigned numTypeInfos, std::vector structVals; llvm::Constant *nextStruct; - llvm::GlobalVariable *nextGlobal = NULL; // Generate each type info // @@ -1702,7 +1698,6 @@ static void createStandardUtilityFunctions(unsigned numTypeInfos, typeInfoName = typeInfoNameBuilder.str(); // Note: Does not seem to work without allocation - nextGlobal = new llvm::GlobalVariable(module, ourTypeInfoType, true, -- cgit v1.2.3-70-g09d2 From 4ca7e09b7c1e41535f2a1bd86915375d023daf27 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 4 Dec 2012 10:16:57 +0000 Subject: Sort the #include lines of the examples/... tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169249 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/BrainF/BrainF.cpp | 2 +- examples/BrainF/BrainFDriver.cpp | 4 ++-- examples/ExceptionDemo/ExceptionDemo.cpp | 12 ++++++------ examples/Fibonacci/fibonacci.cpp | 16 ++++++++-------- examples/HowToUseJIT/HowToUseJIT.cpp | 8 ++++---- examples/Kaleidoscope/Chapter2/toy.cpp | 2 +- examples/Kaleidoscope/Chapter3/toy.cpp | 4 ++-- examples/Kaleidoscope/Chapter4/toy.cpp | 10 +++++----- examples/Kaleidoscope/Chapter5/toy.cpp | 10 +++++----- examples/Kaleidoscope/Chapter6/toy.cpp | 10 +++++----- examples/Kaleidoscope/Chapter7/toy.cpp | 10 +++++----- examples/ModuleMaker/ModuleMaker.cpp | 8 ++++---- examples/ParallelJIT/ParallelJIT.cpp | 12 ++++++------ 13 files changed, 54 insertions(+), 54 deletions(-) (limited to 'examples/ExceptionDemo/ExceptionDemo.cpp') diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp index b002d1f496..5f023639c4 100644 --- a/examples/BrainF/BrainF.cpp +++ b/examples/BrainF/BrainF.cpp @@ -24,10 +24,10 @@ //===--------------------------------------------------------------------===// #include "BrainF.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" -#include "llvm/ADT/STLExtras.h" #include using namespace llvm; diff --git a/examples/BrainF/BrainFDriver.cpp b/examples/BrainF/BrainFDriver.cpp index 58617b7f38..95b1a84458 100644 --- a/examples/BrainF/BrainFDriver.cpp +++ b/examples/BrainF/BrainFDriver.cpp @@ -25,17 +25,17 @@ //===--------------------------------------------------------------------===// #include "BrainF.h" -#include "llvm/Constants.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Constants.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/ExecutionEngine/JIT.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" -#include #include +#include using namespace llvm; //Command line options diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index 2d35ca73e8..91c2f5c0a1 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -48,20 +48,20 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/DataLayout.h" #include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" #include "llvm/IRBuilder.h" +#include "llvm/Intrinsics.h" +#include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Intrinsics.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/DataLayout.h" -#include "llvm/Target/TargetOptions.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Target/TargetOptions.h" +#include "llvm/Transforms/Scalar.h" // FIXME: Although all systems tested with (Linux, OS X), do not need this // header file included. A user on ubuntu reported, undefined symbols diff --git a/examples/Fibonacci/fibonacci.cpp b/examples/Fibonacci/fibonacci.cpp index 417ad6f4b6..9d21d24c76 100644 --- a/examples/Fibonacci/fibonacci.cpp +++ b/examples/Fibonacci/fibonacci.cpp @@ -23,17 +23,17 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/ExecutionEngine/JIT.h" -#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/GenericValue.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/Instructions.h" +#include "llvm/LLVMContext.h" +#include "llvm/Module.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; static Function *CreateFibFunction(Module *M, LLVMContext &Context) { diff --git a/examples/HowToUseJIT/HowToUseJIT.cpp b/examples/HowToUseJIT/HowToUseJIT.cpp index 5588e923df..544288abc7 100644 --- a/examples/HowToUseJIT/HowToUseJIT.cpp +++ b/examples/HowToUseJIT/HowToUseJIT.cpp @@ -36,15 +36,15 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/ExecutionEngine/JIT.h" #include "llvm/IRBuilder.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/ExecutionEngine/JIT.h" -#include "llvm/ExecutionEngine/Interpreter.h" -#include "llvm/ExecutionEngine/GenericValue.h" -#include "llvm/Support/TargetSelect.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; diff --git a/examples/Kaleidoscope/Chapter2/toy.cpp b/examples/Kaleidoscope/Chapter2/toy.cpp index f4f09d0b35..1cf6caacb6 100644 --- a/examples/Kaleidoscope/Chapter2/toy.cpp +++ b/examples/Kaleidoscope/Chapter2/toy.cpp @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include //===----------------------------------------------------------------------===// diff --git a/examples/Kaleidoscope/Chapter3/toy.cpp b/examples/Kaleidoscope/Chapter3/toy.cpp index c1e34b2f09..6eeb7ac404 100644 --- a/examples/Kaleidoscope/Chapter3/toy.cpp +++ b/examples/Kaleidoscope/Chapter3/toy.cpp @@ -1,11 +1,11 @@ +#include "llvm/Analysis/Verifier.h" #include "llvm/DerivedTypes.h" #include "llvm/IRBuilder.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" -#include "llvm/Analysis/Verifier.h" #include -#include #include +#include #include using namespace llvm; diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp index bc6028c900..4a8f966e63 100644 --- a/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/Chapter4/toy.cpp @@ -1,3 +1,6 @@ +#include "llvm/Analysis/Passes.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/DataLayout.h" #include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" @@ -5,14 +8,11 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Analysis/Passes.h" -#include "llvm/DataLayout.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Transforms/Scalar.h" #include -#include #include +#include #include using namespace llvm; diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp index 2b0b9d54fe..cd005cdeca 100644 --- a/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/Chapter5/toy.cpp @@ -1,3 +1,6 @@ +#include "llvm/Analysis/Passes.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/DataLayout.h" #include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" @@ -5,14 +8,11 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Analysis/Passes.h" -#include "llvm/DataLayout.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Transforms/Scalar.h" #include -#include #include +#include #include using namespace llvm; diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index b751e3516b..a66f68b3fd 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -1,3 +1,6 @@ +#include "llvm/Analysis/Passes.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/DataLayout.h" #include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" @@ -5,14 +8,11 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Analysis/Passes.h" -#include "llvm/DataLayout.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Transforms/Scalar.h" #include -#include #include +#include #include using namespace llvm; diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp index 0ac0996590..6bc1e129ea 100644 --- a/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/examples/Kaleidoscope/Chapter7/toy.cpp @@ -1,3 +1,6 @@ +#include "llvm/Analysis/Passes.h" +#include "llvm/Analysis/Verifier.h" +#include "llvm/DataLayout.h" #include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" @@ -5,14 +8,11 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Analysis/Passes.h" -#include "llvm/DataLayout.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Transforms/Scalar.h" #include -#include #include +#include #include using namespace llvm; diff --git a/examples/ModuleMaker/ModuleMaker.cpp b/examples/ModuleMaker/ModuleMaker.cpp index 6bc52c12a0..7ab38c1b2d 100644 --- a/examples/ModuleMaker/ModuleMaker.cpp +++ b/examples/ModuleMaker/ModuleMaker.cpp @@ -13,12 +13,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/DerivedTypes.h" +#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/LLVMContext.h" +#include "llvm/Module.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp index 305cf1dde0..4c1eb49e16 100644 --- a/examples/ParallelJIT/ParallelJIT.cpp +++ b/examples/ParallelJIT/ParallelJIT.cpp @@ -17,17 +17,17 @@ // call into the JIT at the same time (or the best possible approximation of the // same time). This test had assertion errors until I got the locking right. -#include -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" -#include "llvm/Instructions.h" -#include "llvm/ExecutionEngine/JIT.h" -#include "llvm/ExecutionEngine/Interpreter.h" #include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/ExecutionEngine/JIT.h" +#include "llvm/Instructions.h" +#include "llvm/LLVMContext.h" +#include "llvm/Module.h" #include "llvm/Support/TargetSelect.h" #include +#include using namespace llvm; static Function* createAdd1(Module *M) { -- cgit v1.2.3-70-g09d2