Skip to content

Commit 057e14d

Browse files
committed
[Coverity] Fix unchecked return value, NFC
1 parent a6b9634 commit 057e14d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/CodeGen/MIRParser/MIParser.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ class MIParser {
470470
bool parseJumpTableIndexOperand(MachineOperand &Dest);
471471
bool parseExternalSymbolOperand(MachineOperand &Dest);
472472
bool parseMCSymbolOperand(MachineOperand &Dest);
473-
bool parseMDNode(MDNode *&Node);
473+
[[nodiscard]] bool parseMDNode(MDNode *&Node);
474474
bool parseDIExpression(MDNode *&Expr);
475475
bool parseDILocation(MDNode *&Expr);
476476
bool parseMetadataOperand(MachineOperand &Dest);
@@ -3471,7 +3471,8 @@ bool MIParser::parseHeapAllocMarker(MDNode *&Node) {
34713471
assert(Token.is(MIToken::kw_heap_alloc_marker) &&
34723472
"Invalid token for a heap alloc marker!");
34733473
lex();
3474-
parseMDNode(Node);
3474+
if (parseMDNode(Node))
3475+
return true;
34753476
if (!Node)
34763477
return error("expected a MDNode after 'heap-alloc-marker'");
34773478
if (Token.isNewlineOrEOF() || Token.is(MIToken::coloncolon) ||
@@ -3487,7 +3488,8 @@ bool MIParser::parsePCSections(MDNode *&Node) {
34873488
assert(Token.is(MIToken::kw_pcsections) &&
34883489
"Invalid token for a PC sections!");
34893490
lex();
3490-
parseMDNode(Node);
3491+
if (parseMDNode(Node))
3492+
return true;
34913493
if (!Node)
34923494
return error("expected a MDNode after 'pcsections'");
34933495
if (Token.isNewlineOrEOF() || Token.is(MIToken::coloncolon) ||

0 commit comments

Comments
 (0)