xref: /freebsd/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
10b57cec5SDimitry Andric //===- EnumTables.cpp - Enum to string conversion tables --------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #include "llvm/DebugInfo/PDB/Native/EnumTables.h"
100b57cec5SDimitry Andric #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
1181ad6265SDimitry Andric #include "llvm/Support/ScopedPrinter.h"
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric using namespace llvm;
140b57cec5SDimitry Andric using namespace llvm::pdb;
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric #define PDB_ENUM_CLASS_ENT(enum_class, enum)                                   \
17*bdd1243dSDimitry Andric   { #enum, std::underlying_type_t<enum_class>(enum_class::enum) }
180b57cec5SDimitry Andric 
190b57cec5SDimitry Andric #define PDB_ENUM_ENT(ns, enum)                                                 \
200b57cec5SDimitry Andric   { #enum, ns::enum }
210b57cec5SDimitry Andric 
220b57cec5SDimitry Andric static const EnumEntry<uint16_t> OMFSegMapDescFlagNames[] = {
230b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Read),
240b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Write),
250b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Execute),
260b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, AddressIs32Bit),
270b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsSelector),
280b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsAbsoluteAddress),
290b57cec5SDimitry Andric     PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsGroup),
300b57cec5SDimitry Andric };
310b57cec5SDimitry Andric 
320b57cec5SDimitry Andric namespace llvm {
330b57cec5SDimitry Andric namespace pdb {
getOMFSegMapDescFlagNames()340b57cec5SDimitry Andric ArrayRef<EnumEntry<uint16_t>> getOMFSegMapDescFlagNames() {
35*bdd1243dSDimitry Andric   return ArrayRef(OMFSegMapDescFlagNames);
360b57cec5SDimitry Andric }
370b57cec5SDimitry Andric }
380b57cec5SDimitry Andric }
39