[llvm-commits] [llvm] r81115 - in /llvm/trunk/lib: CodeGen/RegAllocPBQP.cpp CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp CodeGen/SelectionDAG/SelectionDAGBuild.cpp CodeGen/StackSlotColoring.cpp Support/regengine.inc System/Unix/Program.inc Target/ARM/Thumb2SizeReduction.cpp Target/PowerPC/PPCISelLowering.cpp Target/X86/AsmPrinter/X86MCInstLower.cpp Target/X86/X86ISelLowering.cpp Target/XCore/XCoreRegisterInfo.cpp Transforms/Scalar/CondPropagate.cpp

Benjamin Kramer benny.kra at googlemail.com
Sun Sep 6 06:03:46 PDT 2009


Am 06.09.2009 um 14:41 schrieb Duncan Sands:

> Remove some not-really-used variables, as warned
> about by icc (#593, partial).  Patch by Erick Tryzelaar.
>

> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=81115&r1=81114&r2=81115&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp  
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Sun  
> Sep  6 07:41:19 2009
> @@ -1714,11 +1714,9 @@
>   MachineFunction *CurMF = FuncInfo.MF;
>
>   // Figure out which block is immediately after the current one.
> -  MachineBasicBlock *NextBlock = 0;
>   MachineFunction::iterator BBI = CR.CaseBB;
>
> -  if (++BBI != FuncInfo.MF->end())
> -    NextBlock = BBI;
> +  if (++BBI != FuncInfo.MF->end()) {}

This looks weird. I think it can be reduced to
MachineFunction::iterator BBI = CR.CaseBB + 1;

>
>   const BasicBlock *LLVMBB = CR.CaseBB->getBasicBlock();
>
> @@ -1787,11 +1785,9 @@
>   MachineFunction *CurMF = FuncInfo.MF;
>
>   // Figure out which block is immediately after the current one.
> -  MachineBasicBlock *NextBlock = 0;
>   MachineFunction::iterator BBI = CR.CaseBB;
>
> -  if (++BBI != FuncInfo.MF->end())
> -    NextBlock = BBI;
> +  if (++BBI != FuncInfo.MF->end()) {}

dito

>
>   Case& FrontCase = *CR.Range.first;
>   Case& BackCase  = *(CR.Range.second-1);
>
>
> Modified: llvm/trunk/lib/Support/regengine.inc
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/regengine.inc?rev=81115&r1=81114&r2=81115&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Support/regengine.inc (original)
> +++ llvm/trunk/lib/Support/regengine.inc Sun Sep  6 07:41:19 2009
> @@ -302,7 +302,6 @@
> 	char *ssp;	/* start of string matched by subsubRE */
> 	char *sep;	/* end of string matched by subsubRE */
> 	char *oldssp;	/* previous ssp */
> -	char *dp;
>
> 	AT("diss", start, stop, startst, stopst);
> 	sp = start;
> @@ -361,7 +360,7 @@
> 			esub = es - 1;
> 			/* did innards match? */
> 			if (slow(m, sp, rest, ssub, esub) != NULL) {
> -				dp = dissect(m, sp, rest, ssub, esub);
> +				char *dp = dissect(m, sp, rest, ssub, esub);
> 				assert(dp == rest);

this change will probably cause "unused variable" warnings in -Asserts  
build

> 			} else		/* no */
> 				assert(sp == rest);
> @@ -399,8 +398,10 @@
> 			}
> 			assert(sep == rest);	/* must exhaust substring */
> 			assert(slow(m, ssp, sep, ssub, esub) == rest);
> -			dp = dissect(m, ssp, sep, ssub, esub);
> -			assert(dp == sep);
> +			{
> +				char *dp = dissect(m, ssp, sep, ssub, esub);
> +				assert(dp == sep);
> +			}

dito

> 			sp = rest;
> 			break;
> 		case OCH_:
> @@ -434,8 +435,10 @@
> 				else
> 					assert(OP(m->g->strip[esub]) == O_CH);
> 			}
> -			dp = dissect(m, sp, rest, ssub, esub);
> -			assert(dp == rest);
> +			{
> +				char *dp = dissect(m, sp, rest, ssub, esub);
> +				assert(dp == rest);
> +			}

dito

> 			sp = rest;
> 			break;
> 		case O_PLUS:
>
> Modified: llvm/trunk/lib/System/Unix/Program.inc
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=81115&r1=81114&r2=81115&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/System/Unix/Program.inc (original)
> +++ llvm/trunk/lib/System/Unix/Program.inc Sun Sep  6 07:41:19 2009
> @@ -116,9 +116,7 @@
>   return false;
> }
>
> -static bool Timeout = false;
> static void TimeOutHandler(int Sig) {
> -  Timeout = true;
> }

It looks like this function can be removed entirely

>
> static void SetMemoryLimits (unsigned size)
> @@ -233,7 +231,6 @@
>
>   // Install a timeout handler.
>   if (secondsToWait) {
> -    Timeout = false;
>     Act.sa_sigaction = 0;
>     Act.sa_handler = TimeOutHandler;
>     sigemptyset(&Act.sa_mask);



More information about the llvm-commits mailing list