diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-07-28 15:57:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-28 15:57:49 +0200 |
commit | 904de95e713b09fa0ba86c53bf62a195e5036c00 (patch) | |
tree | 8618ab3577794597096296bc4cedfcb0fa381a16 /clang/lib/AST/ByteCode/InterpBuiltin.cpp | |
parent | 01d4b8e9a6aea5decfac07a81b40b7db29e8bd8f (diff) | |
download | llvm-904de95e713b09fa0ba86c53bf62a195e5036c00.zip llvm-904de95e713b09fa0ba86c53bf62a195e5036c00.tar.gz llvm-904de95e713b09fa0ba86c53bf62a195e5036c00.tar.bz2 |
[clang][bytecode][NFC] Fix a few clang-tidy complaints (#150940)
Diffstat (limited to 'clang/lib/AST/ByteCode/InterpBuiltin.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/InterpBuiltin.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index 19d4c0c..3ece7054 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -240,9 +240,9 @@ static bool interp__builtin_strcmp(InterpState &S, CodePtr OpPC, T CB = PB.deref<T>(); if (CA > CB) return returnResult(1); - else if (CA < CB) + if (CA < CB) return returnResult(-1); - else if (CA.isZero() || CB.isZero()) + if (CA.isZero() || CB.isZero()) return returnResult(0); }); continue; @@ -253,7 +253,7 @@ static bool interp__builtin_strcmp(InterpState &S, CodePtr OpPC, if (CA > CB) return returnResult(1); - else if (CA < CB) + if (CA < CB) return returnResult(-1); if (CA == 0 || CB == 0) return returnResult(0); @@ -1048,7 +1048,7 @@ static bool interp__builtin_atomic_lock_free(InterpState &S, CodePtr OpPC, PtrArg = ICE->getSubExpr(); } - if (auto PtrTy = PtrArg->getType()->getAs<PointerType>()) { + if (const auto *PtrTy = PtrArg->getType()->getAs<PointerType>()) { QualType PointeeType = PtrTy->getPointeeType(); if (!PointeeType->isIncompleteType() && S.getASTContext().getTypeAlignInChars(PointeeType) >= Size) { @@ -1967,7 +1967,8 @@ static bool interp__builtin_memcmp(InterpState &S, CodePtr OpPC, if (A < B) { pushInteger(S, -1, Call->getType()); return true; - } else if (A > B) { + } + if (A > B) { pushInteger(S, 1, Call->getType()); return true; } @@ -1979,7 +1980,8 @@ static bool interp__builtin_memcmp(InterpState &S, CodePtr OpPC, if (A < B) { pushInteger(S, -1, Call->getType()); return true; - } else if (A > B) { + } + if (A > B) { pushInteger(S, 1, Call->getType()); return true; } |