Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)

llvm-svn: 44281
This commit is contained in:
Anton Korobeynikov 2007-11-22 22:30:10 +00:00
parent a915b538d3
commit 59c11686cc
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,10 @@ bool SimpleInliner::doInitialization(CallGraph &CG) {
if (GV == 0)
return false;
// Don't crash on invalid code
if (!GV->hasInitializer())
return false;
const ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
if (InitList == 0)