llvm/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h

//===- SymbolRecord.h -------------------------------------------*- 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
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
#define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H

#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/DebugInfo/CodeView/CVRecord.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
#include "llvm/Support/BinaryStreamArray.h"
#include "llvm/Support/Endian.h"
#include <cstdint>
#include <vector>

namespace llvm {
namespace codeview {

class SymbolRecord {};

// S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or
// S_LPROC32_DPC_ID
class ProcSym : public SymbolRecord {};

// S_THUNK32
class Thunk32Sym : public SymbolRecord {};

// S_TRAMPOLINE
class TrampolineSym : public SymbolRecord {};

// S_SECTION
class SectionSym : public SymbolRecord {};

// S_COFFGROUP
class CoffGroupSym : public SymbolRecord {};

class ScopeEndSym : public SymbolRecord {};

class JumpTableSym : public SymbolRecord {};

class CallerSym : public SymbolRecord {};

struct DecodedAnnotation {};

struct BinaryAnnotationIterator
    : public iterator_facade_base<BinaryAnnotationIterator,
                                  std::forward_iterator_tag,
                                  DecodedAnnotation> {};

// S_INLINESITE
class InlineSiteSym : public SymbolRecord {};

struct PublicSym32Header {};

// S_PUB32
class PublicSym32 : public SymbolRecord {};

// S_REGISTER
class RegisterSym : public SymbolRecord {};

// S_PROCREF, S_LPROCREF
class ProcRefSym : public SymbolRecord {};

// S_LOCAL
class LocalSym : public SymbolRecord {};

struct LocalVariableAddrRange {};

struct LocalVariableAddrGap {};

enum : uint16_t {};

// S_DEFRANGE
class DefRangeSym : public SymbolRecord {};

// S_DEFRANGE_SUBFIELD
class DefRangeSubfieldSym : public SymbolRecord {};

struct DefRangeRegisterHeader {};

// S_DEFRANGE_REGISTER
class DefRangeRegisterSym : public SymbolRecord {};

struct DefRangeSubfieldRegisterHeader {};

// S_DEFRANGE_SUBFIELD_REGISTER
class DefRangeSubfieldRegisterSym : public SymbolRecord {};

struct DefRangeFramePointerRelHeader {};

// S_DEFRANGE_FRAMEPOINTER_REL
class DefRangeFramePointerRelSym : public SymbolRecord {};

struct DefRangeRegisterRelHeader {};

// S_DEFRANGE_REGISTER_REL
class DefRangeRegisterRelSym : public SymbolRecord {};

// S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE
class DefRangeFramePointerRelFullScopeSym : public SymbolRecord {};

// S_BLOCK32
class BlockSym : public SymbolRecord {};

// S_LABEL32
class LabelSym : public SymbolRecord {};

// S_OBJNAME
class ObjNameSym : public SymbolRecord {};

// S_ENVBLOCK
class EnvBlockSym : public SymbolRecord {};

// S_EXPORT
class ExportSym : public SymbolRecord {};

// S_FILESTATIC
class FileStaticSym : public SymbolRecord {};

// S_COMPILE2
class Compile2Sym : public SymbolRecord {};

// S_COMPILE3
class Compile3Sym : public SymbolRecord {};

// S_FRAMEPROC
class FrameProcSym : public SymbolRecord {};

// S_CALLSITEINFO
class CallSiteInfoSym : public SymbolRecord {};

// S_HEAPALLOCSITE
class HeapAllocationSiteSym : public SymbolRecord {};

// S_FRAMECOOKIE
class FrameCookieSym : public SymbolRecord {};

// S_UDT, S_COBOLUDT
class UDTSym : public SymbolRecord {};

// S_BUILDINFO
class BuildInfoSym : public SymbolRecord {};

// S_BPREL32
class BPRelativeSym : public SymbolRecord {};

// S_REGREL32
class RegRelativeSym : public SymbolRecord {};

// S_CONSTANT, S_MANCONSTANT
class ConstantSym : public SymbolRecord {};

// S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA
class DataSym : public SymbolRecord {};

// S_LTHREAD32, S_GTHREAD32
class ThreadLocalDataSym : public SymbolRecord {};

// S_UNAMESPACE
class UsingNamespaceSym : public SymbolRecord {};

// S_ANNOTATION
class AnnotationSym : public SymbolRecord {};

Expected<CVSymbol> readSymbolFromStream(BinaryStreamRef Stream,
                                        uint32_t Offset);

} // end namespace codeview
} // end namespace llvm

#endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H