| Reka Kovacs | 18775fc | 2018-06-09 13:03:49 +0000 | [diff] [blame] | 1 | //===--- AllocationState.h ------------------------------------- *- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_ALLOCATIONSTATE_H |
| 11 | #define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_ALLOCATIONSTATE_H |
| 12 | |
| Reka Kovacs | e453e60 | 2018-07-07 19:27:18 +0000 | [diff] [blame] | 13 | #include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h" |
| Reka Kovacs | 18775fc | 2018-06-09 13:03:49 +0000 | [diff] [blame] | 14 | #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" |
| 15 | |
| 16 | namespace clang { |
| 17 | namespace ento { |
| 18 | |
| 19 | namespace allocation_state { |
| 20 | |
| 21 | ProgramStateRef markReleased(ProgramStateRef State, SymbolRef Sym, |
| 22 | const Expr *Origin); |
| 23 | |
| Reka Kovacs | e453e60 | 2018-07-07 19:27:18 +0000 | [diff] [blame] | 24 | /// This function provides an additional visitor that augments the bug report |
| 25 | /// with information relevant to memory errors caused by the misuse of |
| Reka Kovacs | 88ad704 | 2018-07-20 15:14:49 +0000 | [diff] [blame] | 26 | /// AF_InnerBuffer symbols. |
| 27 | std::unique_ptr<BugReporterVisitor> getInnerPointerBRVisitor(SymbolRef Sym); |
| Reka Kovacs | e453e60 | 2018-07-07 19:27:18 +0000 | [diff] [blame] | 28 | |
| Reka Kovacs | bb2749a | 2018-08-10 23:56:57 +0000 | [diff] [blame] | 29 | /// 'Sym' represents a pointer to the inner buffer of a container object. |
| 30 | /// This function looks up the memory region of that object in |
| 31 | /// DanglingInternalBufferChecker's program state map. |
| 32 | const MemRegion *getContainerObjRegion(ProgramStateRef State, SymbolRef Sym); |
| 33 | |
| Reka Kovacs | 18775fc | 2018-06-09 13:03:49 +0000 | [diff] [blame] | 34 | } // end namespace allocation_state |
| 35 | |
| 36 | } // end namespace ento |
| 37 | } // end namespace clang |
| 38 | |
| 39 | #endif |