diff options
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); |
