From d6f357421098c8c1a3433d422e87f5b35aeeca29 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 7 Feb 2015 00:36:23 +0000 Subject: Support: Use Dwarf.def for DW_VIRTUALITY, NFC Use definition file for `DW_VIRTUALITY_*`. Add a `DW_VIRTUALITY_max` both for ease of testing and for future use by the `LLParser`. llvm-svn: 228473 --- llvm/lib/Support/Dwarf.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Support/Dwarf.cpp') diff --git a/llvm/lib/Support/Dwarf.cpp b/llvm/lib/Support/Dwarf.cpp index af6db59302c..866d7e55c85 100644 --- a/llvm/lib/Support/Dwarf.cpp +++ b/llvm/lib/Support/Dwarf.cpp @@ -464,11 +464,13 @@ const char *llvm::dwarf::VisibilityString(unsigned Visibility) { const char *llvm::dwarf::VirtualityString(unsigned Virtuality) { switch (Virtuality) { - case DW_VIRTUALITY_none: return "DW_VIRTUALITY_none"; - case DW_VIRTUALITY_virtual: return "DW_VIRTUALITY_virtual"; - case DW_VIRTUALITY_pure_virtual: return "DW_VIRTUALITY_pure_virtual"; + default: + return nullptr; +#define HANDLE_DW_VIRTUALITY(ID, NAME) \ + case DW_VIRTUALITY_##NAME: \ + return "DW_VIRTUALITY_" #NAME; +#include "llvm/Support/Dwarf.def" } - return nullptr; } const char *llvm::dwarf::LanguageString(unsigned Language) { -- cgit v1.2.3