1 //===- ASTContextAllocate.h - ASTContext allocate functions -----*- 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 //  This file declares ASTContext allocation functions separate from the main
10 //  code in ASTContext.h.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CLANG_AST_ASTCONTEXTALLOCATE_H
15 #define LLVM_CLANG_AST_ASTCONTEXTALLOCATE_H
16 
17 #include <cstddef>
18 
19 namespace clang {
20 
21 class ASTContext;
22 
23 } // namespace clang
24 
25 // Defined in ASTContext.h
26 void *operator new(size_t Bytes, const clang::ASTContext &C,
27                    size_t Alignment = 8);
28 void *operator new[](size_t Bytes, const clang::ASTContext &C,
29                      size_t Alignment = 8);
30 
31 // It is good practice to pair new/delete operators.  Also, MSVC gives many
32 // warnings if a matching delete overload is not declared, even though the
33 // throw() spec guarantees it will not be implicitly called.
34 void operator delete(void *Ptr, const clang::ASTContext &C, size_t);
35 void operator delete[](void *Ptr, const clang::ASTContext &C, size_t);
36 
37 #endif // LLVM_CLANG_AST_ASTCONTEXTALLOCATE_H
38