@@ -6564,18 +6564,16 @@ bool LLParser::parseDebugRecord(DbgRecord *&DR, PerFunctionState &PFS) {
6564
6564
6565
6565
// Parse Expression field.
6566
6566
LocTy ExprLoc = Lex.getLoc ();
6567
- Metadata *Expression;
6568
- if (parseMetadata (Expression, &PFS ))
6567
+ MDNode *Expression;
6568
+ if (parseMDNode (Expression))
6569
6569
return true ;
6570
- if (!isa<DIExpression>(Expression))
6571
- return error (ExprLoc, " expected valid inline DIExpression here" );
6572
6570
if (parseToken (lltok::comma, " Expected ',' here" ))
6573
6571
return true ;
6574
6572
6575
6573
// Parse additional fields for #dbg_assign.
6576
6574
MDNode *AssignID = nullptr ;
6577
6575
Metadata *AddressLocation = nullptr ;
6578
- Metadata *AddressExpression = nullptr ;
6576
+ MDNode *AddressExpression = nullptr ;
6579
6577
if (ValueType == LocType::Assign) {
6580
6578
// Parse DIAssignID.
6581
6579
if (parseMDNode (AssignID))
@@ -6591,10 +6589,8 @@ bool LLParser::parseDebugRecord(DbgRecord *&DR, PerFunctionState &PFS) {
6591
6589
6592
6590
// Parse address DIExpression.
6593
6591
LocTy AddressExprLoc = Lex.getLoc ();
6594
- if (parseMetadata (AddressExpression, &PFS ))
6592
+ if (parseMDNode (AddressExpression))
6595
6593
return true ;
6596
- if (!isa<DIExpression>(AddressExpression))
6597
- return error (AddressExprLoc, " expected valid inline DIExpression here" );
6598
6594
if (parseToken (lltok::comma, " Expected ',' here" ))
6599
6595
return true ;
6600
6596
}
@@ -6607,8 +6603,8 @@ bool LLParser::parseDebugRecord(DbgRecord *&DR, PerFunctionState &PFS) {
6607
6603
if (parseToken (lltok::rparen, " Expected ')' here" ))
6608
6604
return true ;
6609
6605
DR = DPValue::createUnresolvedDPValue (
6610
- ValueType, ValLocMD, Variable, cast<DIExpression>( Expression) , AssignID,
6611
- AddressLocation, cast_or_null<DIExpression>( AddressExpression) , DebugLoc);
6606
+ ValueType, ValLocMD, Variable, Expression, AssignID,
6607
+ AddressLocation, AddressExpression, DebugLoc);
6612
6608
return false ;
6613
6609
}
6614
6610
// ===----------------------------------------------------------------------===//
0 commit comments