From 5f970cc5558095132ec4370c37d8465c5de5ed46 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 5 Jan 2009 18:12:21 +0000 Subject: [PATCH] allow opaque undefs. This resolves PR3282 and fixes test/Assembler/2005-05-05-OpaqueUndefValues.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61719 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 8a686ce2f83..da8cb4da23e 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -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(Ty)) return Error(ID.Loc, "invalid type for undef constant"); V = UndefValue::get(Ty); return false; -- 2.11.0