Skip to content

Commit 9e4f289

Browse files
committed
[clang][Interp][NFC] Add [[nodiscard]] attribute to emit functions
1 parent 6515930 commit 9e4f289

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,8 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
16461646
SubExpr, *SubExprT, /*IsConst=*/true, /*IsExtended=*/true)) {
16471647
if (!this->visit(SubExpr))
16481648
return false;
1649-
this->emitSetLocal(*SubExprT, *LocalIndex, E);
1649+
if (!this->emitSetLocal(*SubExprT, *LocalIndex, E))
1650+
return false;
16501651
return this->emitGetPtrLocal(*LocalIndex, E);
16511652
}
16521653
} else {

clang/utils/TableGen/ClangOpcodesEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void ClangOpcodesEmitter::EmitGroup(raw_ostream &OS, StringRef N,
274274

275275
// Emit the prototype of the group emitter in the header.
276276
OS << "#if defined(GET_EVAL_PROTO) || defined(GET_LINK_PROTO)\n";
277-
OS << "bool " << EmitFuncName << "(";
277+
OS << "[[nodiscard]] bool " << EmitFuncName << "(";
278278
for (size_t I = 0, N = Types->size(); I < N; ++I)
279279
OS << "PrimType, ";
280280
for (auto *Arg : Args)

0 commit comments

Comments
 (0)