forked from OSchip/llvm-project
allow opaque undefs. This resolves PR3282 and fixes
test/Assembler/2005-05-05-OpaqueUndefValues.ll llvm-svn: 61719
This commit is contained in:
parent
649d46396f
commit
5261c8923f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue