diff options
| author | Florian Mayer <fmayer@google.com> | 2025-10-22 10:55:10 -0700 |
|---|---|---|
| committer | Florian Mayer <fmayer@google.com> | 2025-10-22 10:55:10 -0700 |
| commit | a0abc0af0a0a90878822f8107d70dad6f7cdfc26 (patch) | |
| tree | 3317f49277cc325327cfe3d9a7be4b6e9bacd0f5 /clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp | |
| parent | e8230892228fd3b3e543c869f1238fa199d48bc1 (diff) | |
| parent | 735b1ad667ac7373c89ccc0f0e757ef418f8f790 (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/fmayer/spr/main.wip-smartpointers
Created using spr 1.3.7
[skip ci]
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp')
| -rw-r--r-- | clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp b/clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp index 7a698f276d6c..15891e2c1f0d 100644 --- a/clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp +++ b/clang/lib/Analysis/FlowSensitive/Models/UncheckedStatusOrAccessModel.cpp @@ -287,11 +287,6 @@ clang::ast_matchers::TypeMatcher statusOrType() { return hasCanonicalType(qualType(hasDeclaration(statusOrClass()))); } -bool isRecordTypeWithName(QualType Type, llvm::StringRef TypeName) { - return Type->isRecordType() && - Type->getAsCXXRecordDecl()->getQualifiedNameAsString() == TypeName; -} - bool isStatusOrType(QualType Type) { return isTypeNamed(Type, {"absl"}, "StatusOr"); } @@ -370,6 +365,8 @@ static void transferStatusOkCall(const CXXMemberCallExpr *Expr, static void transferStatusUpdateCall(const CXXMemberCallExpr *Expr, const MatchFinder::MatchResult &, LatticeTransferState &State) { + // S.Update(OtherS) sets S to the error code of OtherS if it is OK, + // otherwise does nothing. assert(Expr->getNumArgs() == 1); auto *Arg = Expr->getArg(0); RecordStorageLocation *ArgRecord = @@ -455,9 +452,6 @@ static BoolValue *evaluateEquality(const Expr *LhsExpr, const Expr *RhsExpr, return nullptr; return evaluateStatusOrEquality(*LhsStatusOrLoc, *RhsStatusOrLoc, Env); - - // Check the type of both sides in case an operator== is added that admits - // different types. } if (isStatusType(LhsExpr->getType()) && isStatusType(RhsExpr->getType())) { auto *LhsStatusLoc = Env.get<RecordStorageLocation>(*LhsExpr); |
