allow opaque undefs. This resolves PR3282 and fixes

test/Assembler/2005-05-05-OpaqueUndefValues.ll

llvm-svn: 61719
This commit is contained in:
Chris Lattner 2009-01-05 18:12:21 +00:00
parent 649d46396f
commit 5261c8923f
1 changed files with 2 additions and 1 deletions

View File

@ -1913,7 +1913,8 @@ bool LLParser::ConvertGlobalValIDToValue(const Type *Ty, ValID &ID,
return false;
case ValID::t_Undef:
// FIXME: LabelTy should not be a first-class type.
if (!Ty->isFirstClassType() || Ty == Type::LabelTy)
if ((!Ty->isFirstClassType() || Ty == Type::LabelTy) &&
!isa<OpaqueType>(Ty))
return Error(ID.Loc, "invalid type for undef constant");
V = UndefValue::get(Ty);
return false;