clang 22.0.0git
StreamChecker.cpp File Reference

Go to the source code of this file.

Functions

static std::optional< int64_t > getKnownValue (ProgramStateRef State, SVal V)
static ProgramStateRef escapeByStartIndexAndCount (ProgramStateRef State, const CallEvent &Call, unsigned BlockCount, const SubRegion *Buffer, QualType ElemType, int64_t StartIndex, int64_t ElementCount)
 Invalidate only the requested elements instead of the whole buffer.
static ProgramStateRef escapeArgs (ProgramStateRef State, CheckerContext &C, const CallEvent &Call, ArrayRef< unsigned int > EscapingArgs)
static QualType getPointeeType (const MemRegion *R)
static std::optional< NonLocgetStartIndex (SValBuilder &SVB, const MemRegion *R)
static ProgramStateRef tryToInvalidateFReadBufferByElements (ProgramStateRef State, CheckerContext &C, const CallEvent &Call, NonLoc SizeVal, NonLoc NMembVal)
static const VarDeclgetGlobalStreamPointerByName (const TranslationUnitDecl *TU, StringRef VarName)

Function Documentation

◆ escapeArgs()

ProgramStateRef escapeArgs ( ProgramStateRef State,
CheckerContext & C,
const CallEvent & Call,
ArrayRef< unsigned int > EscapingArgs )
static

Definition at line 866 of file StreamChecker.cpp.

References clang::C, and clang::Call.

◆ escapeByStartIndexAndCount()

ProgramStateRef escapeByStartIndexAndCount ( ProgramStateRef State,
const CallEvent & Call,
unsigned BlockCount,
const SubRegion * Buffer,
QualType ElemType,
int64_t StartIndex,
int64_t ElementCount )
static

Invalidate only the requested elements instead of the whole buffer.

This is basically a refinement of the more generic 'escapeArgs' or the plain old 'invalidateRegions'.

Definition at line 836 of file StreamChecker.cpp.

References clang::Call, clang::ento::SubRegion::getMemRegionManager(), clang::ento::SValBuilder::getStateManager(), clang::ento::ProgramStateManager::getSValBuilder(), clang::ento::SValBuilder::makeArrayIndex(), and clang::ento::RegionAndSymbolInvalidationTraits::setTrait().

Referenced by tryToInvalidateFReadBufferByElements().

◆ getGlobalStreamPointerByName()

◆ getKnownValue()

◆ getPointeeType()

QualType getPointeeType ( const MemRegion * R)
static

Definition at line 1076 of file StreamChecker.cpp.

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildFieldReferenceExpr(), buildGlobalBlock(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::SemaObjC::BuildObjCArrayLiteral(), clang::SemaObjC::BuildObjCDictionaryLiteral(), clang::Sema::canCalleeThrow(), checkArithmeticOnObjCPointer(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckCompareOperands(), checkConditionalObjectPointersCompatibility(), checkConditionalPointerCompatibility(), checkObjCPointerTypesForAssignment(), clang::checkSwiftAsyncErrorBlock(), clang::Sema::CheckUnresolvedMemberAccess(), CompareDerivedToBaseConversions(), clang::ConversionFixItGenerator::compareTypesSimple(), computeCachedProperties(), clang::LinkageComputer::computeTypeLinkageInfo(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseCallingConvCast(), diagnoseListInit(), clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitDynamicCast(), clang::CodeGen::CodeGenFunction::EmitPointerArithmetic(), emitWritebackArg(), encodeTypeForFunctionPointerAuth(), clang::SourceLocExpr::EvaluateInContext(), evaluateLValueAsAllocSize(), clang::Expr::findBoundMemberType(), clang::SemaObjC::FindCompositeObjCPointerType(), clang::CXXNewExpr::getAllocatedType(), clang::CXXDeleteExpr::getDestroyedType(), clang::interp::getElemType(), clang::Decl::getFunctionType(), clang::UnresolvedMemberExpr::getNamingClass(), clang::ASTContext::getObjCEncodingForBlock(), clang::AtomicExpr::getValueType(), clang::ASTContext::getVariableArrayDecayedType(), clang::SemaSwift::handleAsyncAttr(), clang::CompletionContextHandler::handleDeclaration(), handleSentinelAttr(), libc_func_matchers::hasUnsafePrintfStringArg(), libc_func_matchers::hasUnsafeSnprintfBuffer(), isDesignatorAtObjectEnd(), clang::Sema::IsFunctionConversion(), clang::SemaOpenMP::isOpenMPCapturedByRef(), IsStructurallyEquivalent(), MarkUsedTemplateParameters(), clang::ASTContext::mergeObjCGCQualifiers(), clang::Sema::MergeTypedefNameDecl(), clang::ASTContext::mergeTypes(), clang::Sema::MergeVarDeclExceptionSpecs(), clang::Sema::PerformImplicitConversion(), clang::BlockPointerType::Profile(), clang::DependentAddressSpaceType::Profile(), clang::MemberPointerType::Profile(), clang::ObjCObjectPointerType::Profile(), clang::PointerType::Profile(), clang::TreeTransform< AdjustConstraintDepth >::RebuildMemberExpr(), setObjCGCLValueClass(), TryListConversion(), TryReferenceInit(), TryReferenceInitialization(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), and tryToInvalidateFReadBufferByElements().

◆ getStartIndex()

◆ tryToInvalidateFReadBufferByElements()