[Alignment][NFC] Use Align with TargetLowering::setMinFunctionAlignment
[llvm-core.git] / include / llvm / DebugInfo / PDB / IPDBEnumChildren.h
blobbfa67d39bc768d41e85ee1eec339faaf1cf663f6
1 //===- IPDBEnumChildren.h - base interface for child enumerator -*- 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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
10 #define LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
12 #include <cassert>
13 #include <cstdint>
14 #include <memory>
16 namespace llvm {
17 namespace pdb {
19 template <typename ChildType> class IPDBEnumChildren {
20 public:
21 using ChildTypePtr = std::unique_ptr<ChildType>;
22 using MyType = IPDBEnumChildren<ChildType>;
24 virtual ~IPDBEnumChildren() = default;
26 virtual uint32_t getChildCount() const = 0;
27 virtual ChildTypePtr getChildAtIndex(uint32_t Index) const = 0;
28 virtual ChildTypePtr getNext() = 0;
29 virtual void reset() = 0;
32 template <typename ChildType>
33 class NullEnumerator : public IPDBEnumChildren<ChildType> {
34 virtual uint32_t getChildCount() const override { return 0; }
35 virtual std::unique_ptr<ChildType>
36 getChildAtIndex(uint32_t Index) const override {
37 return nullptr;
39 virtual std::unique_ptr<ChildType> getNext() override {
40 return nullptr;
42 virtual void reset() override {}
45 } // end namespace pdb
46 } // end namespace llvm
48 #endif // LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H