Zachary Turner | 93839cb | 2016-06-02 05:07:49 +0000 | [diff] [blame] | 1 | //===- EnumTables.cpp - Enum to string conversion tables --------*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame^] | 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 |
Zachary Turner | 93839cb | 2016-06-02 05:07:49 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Adrian McCarthy | 6b6b8c4 | 2017-01-25 22:38:55 +0000 | [diff] [blame] | 9 | #include "llvm/DebugInfo/PDB/Native/EnumTables.h" |
| 10 | #include "llvm/DebugInfo/PDB/Native/RawConstants.h" |
Zachary Turner | 93839cb | 2016-06-02 05:07:49 +0000 | [diff] [blame] | 11 | |
| 12 | using namespace llvm; |
| 13 | using namespace llvm::pdb; |
| 14 | |
| 15 | #define PDB_ENUM_CLASS_ENT(enum_class, enum) \ |
| 16 | { #enum, std::underlying_type < enum_class > ::type(enum_class::enum) } |
| 17 | |
| 18 | #define PDB_ENUM_ENT(ns, enum) \ |
| 19 | { #enum, ns::enum } |
| 20 | |
| 21 | static const EnumEntry<uint16_t> OMFSegMapDescFlagNames[] = { |
| 22 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Read), |
| 23 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Write), |
| 24 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Execute), |
| 25 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, AddressIs32Bit), |
| 26 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsSelector), |
| 27 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsAbsoluteAddress), |
| 28 | PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsGroup), |
| 29 | }; |
| 30 | |
| 31 | namespace llvm { |
| 32 | namespace pdb { |
| 33 | ArrayRef<EnumEntry<uint16_t>> getOMFSegMapDescFlagNames() { |
| 34 | return makeArrayRef(OMFSegMapDescFlagNames); |
| 35 | } |
| 36 | } |
| 37 | } |