//== TrustReturnsNonnullChecker.cpp -- API nullability modeling -*- C++ -*--==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This checker adds nullability-related assumptions to methods annotated with // returns_nonnull attribute. // //===----------------------------------------------------------------------===// #include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" usingnamespaceclang; usingnamespaceento; namespace { class TrustReturnsNonnullChecker : public Checker<check::PostCall> { … }; } // namespace void ento::registerTrustReturnsNonnullChecker(CheckerManager &Mgr) { … } bool ento::shouldRegisterTrustReturnsNonnullChecker(const CheckerManager &mgr) { … }