1 1.1 joerg //===--- AllocationState.h ------------------------------------- *- C++ -*-===// 2 1.1 joerg // 3 1.1 joerg // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 1.1 joerg // See https://llvm.org/LICENSE.txt for license information. 5 1.1 joerg // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 1.1 joerg // 7 1.1 joerg //===----------------------------------------------------------------------===// 8 1.1 joerg 9 1.1 joerg #ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_ALLOCATIONSTATE_H 10 1.1 joerg #define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_ALLOCATIONSTATE_H 11 1.1 joerg 12 1.1 joerg #include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h" 13 1.1 joerg #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" 14 1.1 joerg 15 1.1 joerg namespace clang { 16 1.1 joerg namespace ento { 17 1.1 joerg 18 1.1 joerg namespace allocation_state { 19 1.1 joerg 20 1.1 joerg ProgramStateRef markReleased(ProgramStateRef State, SymbolRef Sym, 21 1.1 joerg const Expr *Origin); 22 1.1 joerg 23 1.1 joerg /// This function provides an additional visitor that augments the bug report 24 1.1 joerg /// with information relevant to memory errors caused by the misuse of 25 1.1 joerg /// AF_InnerBuffer symbols. 26 1.1 joerg std::unique_ptr<BugReporterVisitor> getInnerPointerBRVisitor(SymbolRef Sym); 27 1.1 joerg 28 1.1 joerg /// 'Sym' represents a pointer to the inner buffer of a container object. 29 1.1 joerg /// This function looks up the memory region of that object in 30 1.1 joerg /// DanglingInternalBufferChecker's program state map. 31 1.1 joerg const MemRegion *getContainerObjRegion(ProgramStateRef State, SymbolRef Sym); 32 1.1 joerg 33 1.1 joerg } // end namespace allocation_state 34 1.1 joerg 35 1.1 joerg } // end namespace ento 36 1.1 joerg } // end namespace clang 37 1.1 joerg 38 1.1 joerg #endif 39