Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:40

0001 //===- TypeCollection.h - A collection of CodeView type records -*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPECOLLECTION_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_TYPECOLLECTION_H
0011 
0012 #include "llvm/ADT/StringRef.h"
0013 #include "llvm/DebugInfo/CodeView/CVRecord.h"
0014 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
0015 
0016 namespace llvm {
0017 namespace codeview {
0018 class TypeCollection {
0019 public:
0020   virtual ~TypeCollection() = default;
0021 
0022   bool empty() { return size() == 0; }
0023 
0024   virtual std::optional<TypeIndex> getFirst() = 0;
0025   virtual std::optional<TypeIndex> getNext(TypeIndex Prev) = 0;
0026 
0027   virtual CVType getType(TypeIndex Index) = 0;
0028   virtual StringRef getTypeName(TypeIndex Index) = 0;
0029   virtual bool contains(TypeIndex Index) = 0;
0030   virtual uint32_t size() = 0;
0031   virtual uint32_t capacity() = 0;
0032   virtual bool replaceType(TypeIndex &Index, CVType Data, bool Stabilize) = 0;
0033 
0034   template <typename TFunc> void ForEachRecord(TFunc Func) {
0035     std::optional<TypeIndex> Next = getFirst();
0036 
0037     while (Next) {
0038       TypeIndex N = *Next;
0039       Func(N, getType(N));
0040       Next = getNext(N);
0041     }
0042   }
0043 };
0044 }
0045 }
0046 
0047 #endif