EnumTables.cpp 1.4 KB

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