1336815Sdim//===--- AllocationState.h ------------------------------------- *- C++ -*-===// 2336815Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6336815Sdim// 7336815Sdim//===----------------------------------------------------------------------===// 8336815Sdim 9336815Sdim#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_ALLOCATIONSTATE_H 10336815Sdim#define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_ALLOCATIONSTATE_H 11336815Sdim 12336815Sdim#include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h" 13336815Sdim#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" 14336815Sdim 15336815Sdimnamespace clang { 16336815Sdimnamespace ento { 17336815Sdim 18336815Sdimnamespace allocation_state { 19336815Sdim 20336815SdimProgramStateRef markReleased(ProgramStateRef State, SymbolRef Sym, 21336815Sdim const Expr *Origin); 22336815Sdim 23336815Sdim/// This function provides an additional visitor that augments the bug report 24336815Sdim/// with information relevant to memory errors caused by the misuse of 25336815Sdim/// AF_InnerBuffer symbols. 26336815Sdimstd::unique_ptr<BugReporterVisitor> getInnerPointerBRVisitor(SymbolRef Sym); 27336815Sdim 28344779Sdim/// 'Sym' represents a pointer to the inner buffer of a container object. 29344779Sdim/// This function looks up the memory region of that object in 30344779Sdim/// DanglingInternalBufferChecker's program state map. 31344779Sdimconst MemRegion *getContainerObjRegion(ProgramStateRef State, SymbolRef Sym); 32344779Sdim 33336815Sdim} // end namespace allocation_state 34336815Sdim 35336815Sdim} // end namespace ento 36336815Sdim} // end namespace clang 37336815Sdim 38336815Sdim#endif 39