clang
20.0.0git
|
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/StmtObjC.h"
#include "clang/Analysis/DomainSpecific/CocoaConventions.h"
#include "clang/Analysis/SelectorExtras.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.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/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
Go to the source code of this file.
Enumerations | |
enum | FoundationClass { FC_None , FC_NSArray , FC_NSDictionary , FC_NSEnumerator , FC_NSNull , FC_NSOrderedSet , FC_NSSet , FC_NSString } |
enum | CFNumberType { kCFNumberSInt8Type = 1 , kCFNumberSInt16Type = 2 , kCFNumberSInt32Type = 3 , kCFNumberSInt64Type = 4 , kCFNumberFloat32Type = 5 , kCFNumberFloat64Type = 6 , kCFNumberCharType = 7 , kCFNumberShortType = 8 , kCFNumberIntType = 9 , kCFNumberLongType = 10 , kCFNumberLongLongType = 11 , kCFNumberFloatType = 12 , kCFNumberDoubleType = 13 , kCFNumberCFIndexType = 14 , kCFNumberNSIntegerType = 15 , kCFNumberCGFloatType = 16 } |
enum CFNumberType |
Definition at line 363 of file BasicObjCFoundationChecks.cpp.
enum FoundationClass |
Enumerator | |
---|---|
FC_None | |
FC_NSArray | |
FC_NSDictionary | |
FC_NSEnumerator | |
FC_NSNull | |
FC_NSOrderedSet | |
FC_NSSet | |
FC_NSString |
Definition at line 61 of file BasicObjCFoundationChecks.cpp.
|
static |
If the fist block edge is a back edge, we are reentering the loop.
Definition at line 962 of file BasicObjCFoundationChecks.cpp.
References clang::ento::ExplodedNode::getLocation(), P, and clang::ento::ExplodedNode::preds().
|
static |
Definition at line 951 of file BasicObjCFoundationChecks.cpp.
References assumeCollectionNonEmpty(), clang::ObjCForCollectionStmt::getCollection(), and State.
|
static |
Returns NULL state if the collection is known to contain elements (or is known not to contain elements if the Assumption parameter is false.)
Definition at line 920 of file BasicObjCFoundationChecks.cpp.
References clang::ento::SValBuilder::evalBinOp(), clang::ento::SVal::getAs(), clang::ento::SValBuilder::getConditionType(), clang::ento::SValBuilder::makeIntVal(), and State.
Referenced by assumeCollectionNonEmpty().
|
static |
Assumes that the collection is non-nil.
If the collection is known to be nil, returns NULL to indicate an infeasible path.
Definition at line 860 of file BasicObjCFoundationChecks.cpp.
References clang::ento::SVal::getAs(), clang::ObjCForCollectionStmt::getCollection(), and State.
|
static |
Assumes that the collection elements are non-nil.
This only applies if the collection is one of those known not to contain nil values.
Definition at line 886 of file BasicObjCFoundationChecks.cpp.
References clang::ObjCForCollectionStmt::getCollection(), clang::Expr::getType(), isKnownNonNilCollectionType(), and State.
|
static |
Definition at line 72 of file BasicObjCFoundationChecks.cpp.
References FC_None, FC_NSArray, FC_NSDictionary, FC_NSEnumerator, FC_NSNull, FC_NSOrderedSet, FC_NSSet, FC_NSString, and ID.
Referenced by getMethodReceiverIfKnownImmutable(), and isKnownNonNilCollectionType().
|
static |
Definition at line 382 of file BasicObjCFoundationChecks.cpp.
References clang::ASTContext::CharTy, clang::ASTContext::DoubleTy, clang::ASTContext::FloatTy, clang::ASTContext::getTypeSize(), clang::ASTContext::IntTy, kCFNumberCFIndexType, kCFNumberCGFloatType, kCFNumberCharType, kCFNumberDoubleType, kCFNumberFloatType, kCFNumberIntType, kCFNumberLongLongType, kCFNumberLongType, kCFNumberNSIntegerType, kCFNumberShortType, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::ShortTy, and clang::T.
Definition at line 1057 of file BasicObjCFoundationChecks.cpp.
References FC_None, FC_NSArray, FC_NSDictionary, FC_NSEnumerator, FC_NSNull, FC_NSOrderedSet, FC_NSSet, FC_NSString, findKnownClass(), clang::ObjCMethodDecl::getClassInterface(), and clang::Decl::getDeclContext().
|
static |
Definition at line 55 of file BasicObjCFoundationChecks.cpp.
References clang::ento::ObjCMethodCall::getReceiverInterface(), and ID.
Definition at line 835 of file BasicObjCFoundationChecks.cpp.
References FC_NSArray, FC_NSDictionary, FC_NSEnumerator, FC_NSOrderedSet, FC_NSSet, findKnownClass(), clang::Type::getAs(), clang::ObjCObjectPointerType::getInterfaceDecl(), ID, and clang::T.
Referenced by checkElementNonNil().