diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 | 
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 | 
| commit | 600c6fa13de5c407dc36dbb0ab73807868741ae0 (patch) | |
| tree | 49817b316c4fdaa56d9d16ebf2555303d1a990e0 /lib/Transforms/Scalar/SimplifyCFGPass.cpp | |
| parent | 93338c197185f946619794ce011ec27b5b6250e2 (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/Scalar/SimplifyCFGPass.cpp')
| -rw-r--r-- | lib/Transforms/Scalar/SimplifyCFGPass.cpp | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/lib/Transforms/Scalar/SimplifyCFGPass.cpp index b499279c69693..5a85a047bec33 100644 --- a/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -125,13 +125,17 @@ static bool MarkAliveBlocks(BasicBlock *BB,          }        } -      if (StoreInst *SI = dyn_cast<StoreInst>(BBI)) -        if (isa<ConstantPointerNull>(SI->getOperand(1)) || -            isa<UndefValue>(SI->getOperand(1))) { +      if (StoreInst *SI = dyn_cast<StoreInst>(BBI)) { +        Value *Ptr = SI->getOperand(1); +         +        if (isa<UndefValue>(Ptr) || +            (isa<ConstantPointerNull>(Ptr) && +             cast<PointerType>(Ptr->getType())->getAddressSpace() == 0)) {            ChangeToUnreachable(SI);            Changed = true;            break;          } +      }      }      // Turn invokes that call 'nounwind' functions into ordinary calls. | 
