aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2025-08-08 15:52:23 +0200
committerGitHub <noreply@github.com>2025-08-08 15:52:23 +0200
commit3ea76af3a15af7650b3a900f7418809f452b10f7 (patch)
tree6a7825e3bab16634afe47b2277669ef70e085dbe
parentd54516b9ad70e3f27ccd1dd0b9599aea44ddeb2d (diff)
downloadllvm-3ea76af3a15af7650b3a900f7418809f452b10f7.zip
llvm-3ea76af3a15af7650b3a900f7418809f452b10f7.tar.gz
llvm-3ea76af3a15af7650b3a900f7418809f452b10f7.tar.bz2
[clang][bytecode][NFC] Remove a useless local variable (#152711)
We can just check NonNullArgs.empty().
-rw-r--r--clang/lib/AST/ByteCode/Compiler.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index cc99efa..f656687 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -2063,12 +2063,9 @@ bool Compiler<Emitter>::visitCallArgs(ArrayRef<const Expr *> Args,
const FunctionDecl *FuncDecl,
bool Activate) {
assert(VarScope->getKind() == ScopeKind::Call);
- bool HasNonNullAttr = false;
llvm::BitVector NonNullArgs;
- if (FuncDecl && FuncDecl->hasAttr<NonNullAttr>()) {
- HasNonNullAttr = true;
+ if (FuncDecl && FuncDecl->hasAttr<NonNullAttr>())
NonNullArgs = collectNonNullArgs(FuncDecl, Args);
- }
unsigned ArgIndex = 0;
for (const Expr *Arg : Args) {
@@ -2094,7 +2091,7 @@ bool Compiler<Emitter>::visitCallArgs(ArrayRef<const Expr *> Args,
return false;
}
- if (HasNonNullAttr && NonNullArgs[ArgIndex]) {
+ if (!NonNullArgs.empty() && NonNullArgs[ArgIndex]) {
PrimType ArgT = classify(Arg).value_or(PT_Ptr);
if (ArgT == PT_Ptr) {
if (!this->emitCheckNonNullArg(ArgT, Arg))