llvm/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h

//===- FormatUtil.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_PDB_NATIVE_FORMATUTIL_H
#define LLVM_DEBUGINFO_PDB_NATIVE_FORMATUTIL_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FormatAdapters.h"
#include "llvm/Support/FormatVariadic.h"

#include <string>
#include <type_traits>

namespace llvm {
namespace pdb {

#define PUSH_MASKED_FLAG(Enum, Mask, TheOpt, Value, Text)

#define PUSH_FLAG(Enum, TheOpt, Value, Text)

#define RETURN_CASE(Enum, X, Ret)

template <typename T> std::string formatUnknownEnum(T Value) {}

std::string formatSegmentOffset(uint16_t Segment, uint32_t Offset);

enum class CharacteristicStyle {};
std::string formatSectionCharacteristics(
    uint32_t IndentLevel, uint32_t C, uint32_t FlagsPerLine,
    StringRef Separator,
    CharacteristicStyle Style = CharacteristicStyle::HeaderDefinition);

std::string typesetItemList(ArrayRef<std::string> Opts, uint32_t IndentLevel,
                            uint32_t GroupSize, StringRef Sep);

std::string typesetStringList(uint32_t IndentLevel,
                              ArrayRef<StringRef> Strings);

std::string formatChunkKind(codeview::DebugSubsectionKind Kind,
                            bool Friendly = true);
std::string formatSymbolKind(codeview::SymbolKind K);
std::string formatTypeLeafKind(codeview::TypeLeafKind K);

/// Returns the number of digits in the given integer.
inline int NumDigits(uint64_t N) {}

namespace detail {
template <typename T>
struct EndianAdapter final
    : public FormatAdapter<support::detail::packed_endian_specific_integral<
          T, llvm::endianness::little, support::unaligned>> {};
} // namespace detail

template <typename T>
detail::EndianAdapter<T> fmtle(support::detail::packed_endian_specific_integral<
                               T, llvm::endianness::little, support::unaligned>
                                   Value) {}
} // namespace pdb
} // namespace llvm
#endif