//===- ASTVector.h - Vector that uses ASTContext for allocation ---*- C++ -*-=// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides ASTVector, a vector ADT whose contents are // allocated using the allocator associated with an ASTContext.. // //===----------------------------------------------------------------------===// // FIXME: Most of this is copy-and-paste from BumpVector.h and SmallVector.h. // We can refactor this core logic into something common. #ifndef LLVM_CLANG_AST_ASTVECTOR_H #define LLVM_CLANG_AST_ASTVECTOR_H #include "clang/AST/ASTContextAllocate.h" #include "llvm/ADT/PointerIntPair.h" #include <algorithm> #include <cassert> #include <cstddef> #include <cstring> #include <iterator> #include <memory> #include <type_traits> #include <utility> namespace clang { class ASTContext; template<typename T> class ASTVector { … }; // Define this out-of-line to dissuade the C++ compiler from inlining it. template <typename T> void ASTVector<T>::grow(const ASTContext &C, size_t MinSize) { … } } // namespace clang #endif // LLVM_CLANG_AST_ASTVECTOR_H