clang API Documentation
#include "ClangSACheckers.h"
#include "InterCheckerAPI.h"
#include "clang/AST/Attr.h"
#include "clang/AST/ParentMap.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "llvm/ADT/ImmutableMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include <climits>
Go to the source code of this file.
Defines | |
#define | CASE(ID) case ID: OS << #ID; break; |
#define | REGISTER_CHECKER(name) |
Enumerations | |
enum | AllocationFamily |
enum | ReallocPairKind |
Functions | |
static QualType | getDeepPointeeType (QualType T) |
static bool | treatUnusedNewEscaped (const CXXNewExpr *NE) |
static bool | isKnownDeallocObjCMethodName (const ObjCMethodCall &Call) |
static Optional< bool > | getFreeWhenDoneArg (const ObjCMethodCall &Call) |
static bool | didPreviousFreeFail (ProgramStateRef State, SymbolRef Sym, SymbolRef &RetStatusSymbol) |
static bool | retTrue (const RefState *RS) |
static bool | checkIfNewOrNewArrayFamily (const RefState *RS) |
static SymbolRef | findFailedReallocSymbol (ProgramStateRef currState, ProgramStateRef prevState) |
#define REGISTER_CHECKER | ( | name | ) |
void ento::register##name(CheckerManager &mgr) { \ registerCStringCheckerBasic(mgr); \ MallocChecker *checker = mgr.registerChecker<MallocChecker>(); \ checker->ChecksEnabled[MallocChecker::CK_##name] = true; \ checker->CheckNames[MallocChecker::CK_##name] = mgr.getCurrentCheckName(); \ }
Definition at line 2469 of file MallocChecker.cpp.
enum AllocationFamily |
Definition at line 41 of file MallocChecker.cpp.
enum ReallocPairKind |
Definition at line 118 of file MallocChecker.cpp.
static bool checkIfNewOrNewArrayFamily | ( | const RefState * | RS | ) | [static] |
Definition at line 2279 of file MallocChecker.cpp.
static bool didPreviousFreeFail | ( | ProgramStateRef | State, |
SymbolRef | Sym, | ||
SymbolRef & | RetStatusSymbol | ||
) | [static] |
Checks if the previous call to free on the given symbol failed - if free failed, returns true. Also, returns the corresponding return value symbol.
Definition at line 1028 of file MallocChecker.cpp.
References clang::ento::ConditionTruthVal::isConstrainedTrue(), and clang::ento::ConstraintManager::isNull().
static SymbolRef findFailedReallocSymbol | ( | ProgramStateRef | currState, |
ProgramStateRef | prevState | ||
) | [static] |
Definition at line 2332 of file MallocChecker.cpp.
static QualType getDeepPointeeType | ( | QualType | T | ) | [static] |
Definition at line 793 of file MallocChecker.cpp.
References clang::Type::getPointeeType().
Referenced by treatUnusedNewEscaped().
static Optional<bool> getFreeWhenDoneArg | ( | const ObjCMethodCall & | Call | ) | [static] |
Definition at line 888 of file MallocChecker.cpp.
References clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), and clang::ObjCMethodCall::getSelector().
static bool isKnownDeallocObjCMethodName | ( | const ObjCMethodCall & | Call | ) | [static] |
Definition at line 873 of file MallocChecker.cpp.
References clang::Selector::getNameForSlot(), and clang::ObjCMethodCall::getSelector().
Definition at line 2275 of file MallocChecker.cpp.
static bool treatUnusedNewEscaped | ( | const CXXNewExpr * | NE | ) | [static] |
Definition at line 802 of file MallocChecker.cpp.
References clang::CXXNewExpr::getAllocatedType(), clang::Type::getAsCXXRecordDecl(), clang::CXXNewExpr::getConstructExpr(), clang::CXXConstructExpr::getConstructor(), getDeepPointeeType(), clang::Type::getPointeeType(), clang::QualType::isNull(), and clang::FunctionDecl::params().