//===- BumpVector.h - Vector-like ADT that uses bump 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 BumpVector, a vector-like ADT whose contents are // allocated from a BumpPtrAllocator. // //===----------------------------------------------------------------------===// // FIXME: Most of this is copy-and-paste from SmallVector.h. We can // refactor this core logic into something common that is shared between // the two. The main thing that is different is the allocation strategy. #ifndef LLVM_CLANG_ANALYSIS_SUPPORT_BUMPVECTOR_H #define LLVM_CLANG_ANALYSIS_SUPPORT_BUMPVECTOR_H #include "llvm/ADT/PointerIntPair.h" #include "llvm/Support/Allocator.h" #include <cassert> #include <cstddef> #include <cstring> #include <iterator> #include <memory> #include <type_traits> namespace clang { class BumpVectorContext { … }; template<typename T> class BumpVector { … }; // Define this out-of-line to dissuade the C++ compiler from inlining it. template <typename T> void BumpVector<T>::grow(BumpVectorContext &C, size_t MinSize) { … } } // namespace clang #endif // LLVM_CLANG_ANALYSIS_SUPPORT_BUMPVECTOR_H