diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-08-27 09:48:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-27 09:48:57 +0200 |
commit | b424207cdddfa2cbfc9129bbe0a31e47cb04e6dc (patch) | |
tree | 2a7d9c0cbb97c13b24292b980fdaca4016d9f54e /clang/lib/AST/ExprConstant.cpp | |
parent | 8a9e3333ddcf6b13d6a944b1380a828df6f08a6d (diff) | |
download | llvm-b424207cdddfa2cbfc9129bbe0a31e47cb04e6dc.zip llvm-b424207cdddfa2cbfc9129bbe0a31e47cb04e6dc.tar.gz llvm-b424207cdddfa2cbfc9129bbe0a31e47cb04e6dc.tar.bz2 |
[clang] Post-commit review for #150028 (#155351)
1) Return `std::nullopt` instead of `{}`.
2) Rename the new function to evaluate*, it's not a simple getter.
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 19703e4..c93a218 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -9465,7 +9465,8 @@ static bool getBytesReturnedByAllocSizeCall(const ASTContext &Ctx, "Can't get the size of a non alloc_size function"); const auto *Base = LVal.getLValueBase().get<const Expr *>(); const CallExpr *CE = tryUnwrapAllocSizeCall(Base); - std::optional<llvm::APInt> Size = CE->getBytesReturnedByAllocSizeCall(Ctx); + std::optional<llvm::APInt> Size = + CE->evaluateBytesReturnedByAllocSizeCall(Ctx); if (!Size) return false; |