AllocationState.h 1.4 KB

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