1//===- EnumTables.cpp - Enum to string conversion tables --------*- 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//===----------------------------------------------------------------------===//
8
9#include "llvm/DebugInfo/PDB/Native/EnumTables.h"
10#include "llvm/ADT/Enum.h"
11#include "llvm/DebugInfo/PDB/Native/RawConstants.h"
12
13using namespace llvm;
14
15EnumStrings<uint16_t> llvm::pdb::getOMFSegMapDescFlagNames() {
16#define PDB_ENUM_CLASS_ENT(enum_class, enum) \
17 { \
18 {#enum}, std::underlying_type_t<enum_class>(enum_class::enum) \
19 }
20 constexpr EnumStringDef<uint16_t> Defs[] = {
21 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Read),
22 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Write),
23 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Execute),
24 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, AddressIs32Bit),
25 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsSelector),
26 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsAbsoluteAddress),
27 PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsGroup),
28 };
29 static constexpr auto Names = BUILD_ENUM_STRINGS(Defs);
30 return EnumStrings(Names);
31}
32