EnumTables.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "llvm/DebugInfo/PDB/Native/EnumTables.h"
  9. #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
  10. using namespace llvm;
  11. using namespace llvm::pdb;
  12. #define PDB_ENUM_CLASS_ENT(enum_class, enum) \
  13. { #enum, std::underlying_type < enum_class > ::type(enum_class::enum) }
  14. #define PDB_ENUM_ENT(ns, enum) \
  15. { #enum, ns::enum }
  16. static const EnumEntry<uint16_t> OMFSegMapDescFlagNames[] = {
  17. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Read),
  18. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Write),
  19. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, Execute),
  20. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, AddressIs32Bit),
  21. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsSelector),
  22. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsAbsoluteAddress),
  23. PDB_ENUM_CLASS_ENT(OMFSegDescFlags, IsGroup),
  24. };
  25. namespace llvm {
  26. namespace pdb {
  27. ArrayRef<EnumEntry<uint16_t>> getOMFSegMapDescFlagNames() {
  28. return makeArrayRef(OMFSegMapDescFlagNames);
  29. }
  30. }
  31. }