Skip to content

Commit

Permalink
[clang][Interp][NFC] Add [[nodiscard]] attribute to emit functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Mar 7, 2024
1 parent 6515930 commit 9e4f289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion clang/lib/AST/Interp/ByteCodeExprGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,8 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
SubExpr, *SubExprT, /*IsConst=*/true, /*IsExtended=*/true)) {
if (!this->visit(SubExpr))
return false;
this->emitSetLocal(*SubExprT, *LocalIndex, E);
if (!this->emitSetLocal(*SubExprT, *LocalIndex, E))
return false;
return this->emitGetPtrLocal(*LocalIndex, E);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion clang/utils/TableGen/ClangOpcodesEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void ClangOpcodesEmitter::EmitGroup(raw_ostream &OS, StringRef N,

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

0 comments on commit 9e4f289

Please sign in to comment.