clang  14.0.0git
SmartPtr.h
Go to the documentation of this file.
1 //=== SmartPtr.h - Tracking smart pointer state. -------------------*- C++ -*-//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Defines inter-checker API for the smart pointer modeling. It allows
10 // dependent checkers to figure out if an smart pointer is null or not.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_SMARTPTR_H
15 #define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_SMARTPTR_H
16 
18 
19 namespace clang {
20 namespace ento {
21 namespace smartptr {
22 
23 /// Returns true if the event call is on smart pointer.
24 bool isStdSmartPtrCall(const CallEvent &Call);
25 bool isStdSmartPtr(const CXXRecordDecl *RD);
26 bool isStdSmartPtr(const Expr *E);
27 
28 bool isStdSmartPtr(const CXXRecordDecl *RD);
29 
30 /// Returns whether the smart pointer is null or not.
31 bool isNullSmartPtr(const ProgramStateRef State, const MemRegion *ThisRegion);
32 
34 
35 } // namespace smartptr
36 } // namespace ento
37 } // namespace clang
38 
39 #endif // LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_SMARTPTR_H
clang::ento::smartptr::getNullDereferenceBugType
const BugType * getNullDereferenceBugType()
Definition: SmartPtrChecker.cpp:54
clang::ento::smartptr::isStdSmartPtr
bool isStdSmartPtr(const CXXRecordDecl *RD)
Definition: SmartPtrModeling.cpp:132
CallEvent.h
clang::ento::MemRegion
MemRegion - The root abstract class for all memory regions.
Definition: MemRegion.h:94
clang::ento::smartptr::isNullSmartPtr
bool isNullSmartPtr(const ProgramStateRef State, const MemRegion *ThisRegion)
Returns whether the smart pointer is null or not.
Definition: SmartPtrModeling.cpp:147
clang::ento::BugType
Definition: BugType.h:29
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:255
State
LineState State
Definition: UnwrappedLineFormatter.cpp:986
clang
Definition: CalledOnceCheck.h:17
clang::ento::CallEvent
Represents an abstract call to a function or method along a particular path.
Definition: CallEvent.h:143
clang::ento::smartptr::isStdSmartPtrCall
bool isStdSmartPtrCall(const CallEvent &Call)
Returns true if the event call is on smart pointer.
Definition: SmartPtrModeling.cpp:125
clang::Expr
This represents one expression.
Definition: Expr.h:109
llvm::IntrusiveRefCntPtr
Definition: LLVM.h:47