diff options
| author | Jim Ingham <jingham@apple.com> | 2016-09-15 01:47:22 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2016-09-15 01:47:22 +0000 |
| commit | 75f0f5830b424446fe44048def7e1592b60f1da5 (patch) | |
| tree | 3109260063b6231977c0d844546810a1a4743267 /lldb | |
| parent | a5277d59d086ed8950847af5363ea1759d395557 (diff) | |
| download | bcm5719-llvm-75f0f5830b424446fe44048def7e1592b60f1da5.tar.gz bcm5719-llvm-75f0f5830b424446fe44048def7e1592b60f1da5.zip | |
Make the keys enumerations for options and resolvers enum classes.
This keeps them from conflicting with other symbols names, so it's
worth their being less convenient to use for indexing.
llvm-svn: 281569
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/include/lldb/Breakpoint/BreakpointOptions.h | 7 | ||||
| -rw-r--r-- | lldb/include/lldb/Breakpoint/BreakpointResolver.h | 7 | ||||
| -rw-r--r-- | lldb/source/Breakpoint/BreakpointOptions.cpp | 5 | ||||
| -rw-r--r-- | lldb/source/Breakpoint/BreakpointResolver.cpp | 10 |
4 files changed, 16 insertions, 13 deletions
diff --git a/lldb/include/lldb/Breakpoint/BreakpointOptions.h b/lldb/include/lldb/Breakpoint/BreakpointOptions.h index 0b4c9ddc08e..97de7717911 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointOptions.h +++ b/lldb/include/lldb/Breakpoint/BreakpointOptions.h @@ -51,17 +51,18 @@ public: bool stop_on_error; private: - enum OptionNames { + enum class OptionNames : uint32_t { UserSource = 0, ScriptSource, StopOnError, LastOptionName }; - static const char *g_option_names[LastOptionName]; + static const char + *g_option_names[static_cast<uint32_t>(OptionNames::LastOptionName)]; static const char *GetKey(enum OptionNames enum_value) { - return g_option_names[enum_value]; + return g_option_names[static_cast<uint32_t>(enum_value)]; } }; diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolver.h b/lldb/include/lldb/Breakpoint/BreakpointResolver.h index cfbb7f68f0a..a33b31d9345 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointResolver.h +++ b/lldb/include/lldb/Breakpoint/BreakpointResolver.h @@ -202,7 +202,7 @@ protected: // Used for serializing resolver options: // The options in this enum and the strings in the // g_option_names must be kept in sync. - enum OptionNames { + enum class OptionNames : uint32_t { AddressOffset = 0, ExactMatch, FileName, @@ -218,11 +218,12 @@ protected: SymbolNameArray, LastOptionName }; - static const char *g_option_names[LastOptionName]; + static const char + *g_option_names[static_cast<uint32_t>(OptionNames::LastOptionName)]; public: static const char *GetKey(enum OptionNames enum_value) { - return g_option_names[enum_value]; + return g_option_names[static_cast<uint32_t>(enum_value)]; } protected: diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp index 77a8111d993..d55a3447e5d 100644 --- a/lldb/source/Breakpoint/BreakpointOptions.cpp +++ b/lldb/source/Breakpoint/BreakpointOptions.cpp @@ -28,8 +28,9 @@ using namespace lldb; using namespace lldb_private; -const char *BreakpointOptions::CommandData::g_option_names - [BreakpointOptions::CommandData::OptionNames::LastOptionName]{ +const char + *BreakpointOptions::CommandData::g_option_names[static_cast<uint32_t>( + BreakpointOptions::CommandData::OptionNames::LastOptionName)]{ "UserSource", "ScriptSource", "StopOnError"}; StructuredData::ObjectSP diff --git a/lldb/source/Breakpoint/BreakpointResolver.cpp b/lldb/source/Breakpoint/BreakpointResolver.cpp index a7c63c6fabb..d91556e6bb0 100644 --- a/lldb/source/Breakpoint/BreakpointResolver.cpp +++ b/lldb/source/Breakpoint/BreakpointResolver.cpp @@ -42,11 +42,11 @@ const char *BreakpointResolver::g_ty_to_name[] = {"FileAndLine", "Address", "SymbolName", "SourceRegex", "Exception", "Unknown"}; -const char *BreakpointResolver::g_option_names - [BreakpointResolver::OptionNames::LastOptionName] = { - "AddressOffset", "Exact", "FileName", "Inlines", "Language", - "LineNumber", "ModuleName", "NameMask", "Offset", "Regex", - "SectionName", "SkipPrologue", "SymbolNames"}; +const char *BreakpointResolver::g_option_names[static_cast<uint32_t>( + BreakpointResolver::OptionNames::LastOptionName)] = { + "AddressOffset", "Exact", "FileName", "Inlines", "Language", + "LineNumber", "ModuleName", "NameMask", "Offset", "Regex", + "SectionName", "SkipPrologue", "SymbolNames"}; const char *BreakpointResolver::ResolverTyToName(enum ResolverTy type) { if (type > LastKnownResolverType) |

