From 4b794f81917d2799225a9d1951729f1798431f81 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Thu, 23 Feb 2012 08:23:06 +0000 Subject: [PATCH] GCC fails to understand that NextBB is always initialized if EvaluateBlock returns 'true' and emits a warning. Help it out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151242 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/GlobalOpt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 7c78a205448..acb723e1cc8 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2645,7 +2645,7 @@ bool Evaluator::EvaluateFunction(Function *F, Constant *&RetVal, BasicBlock::iterator CurInst = CurBB->begin(); while (1) { - BasicBlock *NextBB; + BasicBlock *NextBB = 0; // Initialized to avoid compiler warnings. if (!EvaluateBlock(CurInst, NextBB)) return false;