From c1dc35094e3ffcb4b3a765f0f786b8a2948bc321 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 31 Oct 2009 20:13:24 +0000 Subject: adjust a couple xforms to work with null bb's in BlockAddress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85680 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/GlobalOpt.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/Transforms/IPO/GlobalOpt.cpp') diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 49e9683a55..94951002b4 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -2345,8 +2345,7 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal, Value *Val = getVal(Values, IBI->getAddress())->stripPointerCasts(); if (BlockAddress *BA = dyn_cast(Val)) NewBB = BA->getBasicBlock(); - else - return false; // Cannot determine. + if (NewBB == 0) return false; // Cannot determine. } else if (ReturnInst *RI = dyn_cast(CurInst)) { if (RI->getNumOperands()) RetVal = getVal(Values, RI->getOperand(0)); -- cgit v1.2.3-70-g09d2