Move.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. //=== Move.h - Tracking moved-from objects. ------------------------*- 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. //
  9. // Defines inter-checker API for the use-after-move checker. It allows
  10. // dependent checkers to figure out if an object is in a moved-from state.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MOVE_H
  14. #define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MOVE_H
  15. #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
  16. namespace clang {
  17. namespace ento {
  18. namespace move {
  19. /// Returns true if the object is known to have been recently std::moved.
  20. bool isMovedFrom(ProgramStateRef State, const MemRegion *Region);
  21. } // namespace move
  22. } // namespace ento
  23. } // namespace clang
  24. #endif // LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MOVE_H