Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- SymbolDumper.h - CodeView symbol info dumper ------------*- 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_SYMBOLDUMPER_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H
0011 
0012 #include "llvm/DebugInfo/CodeView/CVRecord.h"
0013 #include "llvm/DebugInfo/CodeView/CodeView.h"
0014 #include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
0015 #include "llvm/Support/Error.h"
0016 
0017 #include <memory>
0018 #include <utility>
0019 
0020 namespace llvm {
0021 class ScopedPrinter;
0022 
0023 namespace codeview {
0024 class TypeCollection;
0025 
0026 /// Dumper for CodeView symbol streams found in COFF object files and PDB files.
0027 class CVSymbolDumper {
0028 public:
0029   CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types,
0030                  CodeViewContainer Container,
0031                  std::unique_ptr<SymbolDumpDelegate> ObjDelegate, CPUType CPU,
0032                  bool PrintRecordBytes)
0033       : W(W), Types(Types), Container(Container),
0034         ObjDelegate(std::move(ObjDelegate)), CompilationCPUType(CPU),
0035         PrintRecordBytes(PrintRecordBytes) {}
0036 
0037   /// Dumps one type record.  Returns false if there was a type parsing error,
0038   /// and true otherwise.  This should be called in order, since the dumper
0039   /// maintains state about previous records which are necessary for cross
0040   /// type references.
0041   Error dump(CVRecord<SymbolKind> &Record);
0042 
0043   /// Dumps the type records in Data. Returns false if there was a type stream
0044   /// parse error, and true otherwise.
0045   Error dump(const CVSymbolArray &Symbols);
0046 
0047   CPUType getCompilationCPUType() const { return CompilationCPUType; }
0048 
0049 private:
0050   ScopedPrinter &W;
0051   TypeCollection &Types;
0052   CodeViewContainer Container;
0053   std::unique_ptr<SymbolDumpDelegate> ObjDelegate;
0054   CPUType CompilationCPUType;
0055   bool PrintRecordBytes;
0056 };
0057 } // end namespace codeview
0058 } // end namespace llvm
0059 
0060 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLDUMPER_H