ASTContextAllocate.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- ASTContextAllocate.h - ASTContext allocate functions -----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file declares ASTContext allocation functions separate from the main
  15. // code in ASTContext.h.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CLANG_AST_ASTCONTEXTALLOCATE_H
  19. #define LLVM_CLANG_AST_ASTCONTEXTALLOCATE_H
  20. #include <cstddef>
  21. namespace clang {
  22. class ASTContext;
  23. } // namespace clang
  24. // Defined in ASTContext.h
  25. void *operator new(size_t Bytes, const clang::ASTContext &C,
  26. size_t Alignment = 8);
  27. void *operator new[](size_t Bytes, const clang::ASTContext &C,
  28. size_t Alignment = 8);
  29. // It is good practice to pair new/delete operators. Also, MSVC gives many
  30. // warnings if a matching delete overload is not declared, even though the
  31. // throw() spec guarantees it will not be implicitly called.
  32. void operator delete(void *Ptr, const clang::ASTContext &C, size_t);
  33. void operator delete[](void *Ptr, const clang::ASTContext &C, size_t);
  34. #endif // LLVM_CLANG_AST_ASTCONTEXTALLOCATE_H
  35. #ifdef __GNUC__
  36. #pragma GCC diagnostic pop
  37. #endif