diff options
author | Fangrui Song <maskray@google.com> | 2019-05-14 08:55:50 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-05-14 08:55:50 +0000 |
commit | efe8e7e36d01cfa19b8c405fffc3411c8c74cabf (patch) | |
tree | c606cbe8c4fbe0121d85b6d1e02ca27ed505fdf4 | |
parent | 004393681c25e34e921adccc69ae6378090dee54 (diff) | |
download | bcm5719-llvm-efe8e7e36d01cfa19b8c405fffc3411c8c74cabf.tar.gz bcm5719-llvm-efe8e7e36d01cfa19b8c405fffc3411c8c74cabf.zip |
typedef enum -> enum
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D61883
llvm-svn: 360654
48 files changed, 172 insertions, 202 deletions
diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h index 3fab6a4d5f0..7e25d9ff9e3 100644 --- a/lldb/include/lldb/Breakpoint/Breakpoint.h +++ b/lldb/include/lldb/Breakpoint/Breakpoint.h @@ -82,7 +82,7 @@ public: /// An enum specifying the match style for breakpoint settings. At present /// only used for function name style breakpoints. - typedef enum { Exact, Regexp, Glob } MatchType; + enum MatchType { Exact, Regexp, Glob }; private: enum class OptionNames : uint32_t { Names = 0, Hardware, LastOptionName }; diff --git a/lldb/include/lldb/Core/Address.h b/lldb/include/lldb/Core/Address.h index aca73a7c9b9..62a29995fad 100644 --- a/lldb/include/lldb/Core/Address.h +++ b/lldb/include/lldb/Core/Address.h @@ -81,7 +81,7 @@ class Address { public: /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const function /// to display Address contents in a variety of ways. - typedef enum { + enum DumpStyle { DumpStyleInvalid, ///< Invalid dump style DumpStyleSectionNameOffset, ///< Display as the section name + offset. ///< \code @@ -97,7 +97,7 @@ public: /// // address for printf in libSystem.B.dylib as a file address /// 0x000000000005dcff \endcode DumpStyleModuleWithFileAddress, ///< Display as the file address with the - ///module name prepended (if any). + /// module name prepended (if any). ///< \code /// // address for printf in libSystem.B.dylib as a file address /// libSystem.B.dylib[0x000000000005dcff] \endcode @@ -106,22 +106,22 @@ public: /// // address for printf in libSystem.B.dylib as a load address /// 0x00007fff8306bcff \endcode DumpStyleResolvedDescription, ///< Display the details about what an address - ///resolves to. This can + /// resolves to. This can ///< be anything from a symbol context summary (module, function/symbol, ///< and file and line), to information about what the pointer points to ///< if the address is in a section (section of pointers, c strings, etc). DumpStyleResolvedDescriptionNoModule, DumpStyleResolvedDescriptionNoFunctionArguments, DumpStyleNoFunctionName, ///< Elide the function name; display an offset - ///into the current function. + /// into the current function. ///< Used primarily in disassembly symbolication DumpStyleDetailedSymbolContext, ///< Detailed symbol context information for - ///an address for all symbol + /// an address for all symbol ///< context members. DumpStyleResolvedPointerDescription ///< Dereference a pointer at the - ///current address and then lookup the + /// current address and then lookup the ///< dereferenced address using DumpStyleResolvedDescription - } DumpStyle; + }; /// Default constructor. /// diff --git a/lldb/include/lldb/Core/AddressResolver.h b/lldb/include/lldb/Core/AddressResolver.h index 4d459a2c098..1eb13574952 100644 --- a/lldb/include/lldb/Core/AddressResolver.h +++ b/lldb/include/lldb/Core/AddressResolver.h @@ -36,7 +36,7 @@ namespace lldb_private { class AddressResolver : public Searcher { public: - typedef enum { Exact, Regexp, Glob } MatchType; + enum MatchType { Exact, Regexp, Glob }; AddressResolver(); diff --git a/lldb/include/lldb/Core/SearchFilter.h b/lldb/include/lldb/Core/SearchFilter.h index 82c36c5738d..59de910d069 100644 --- a/lldb/include/lldb/Core/SearchFilter.h +++ b/lldb/include/lldb/Core/SearchFilter.h @@ -59,11 +59,11 @@ namespace lldb_private { class Searcher { public: - typedef enum { + enum CallbackReturn { eCallbackReturnStop = 0, // Stop the iteration eCallbackReturnContinue, // Continue the iteration eCallbackReturnPop // Pop one level up and continue iterating - } CallbackReturn; + }; Searcher(); diff --git a/lldb/include/lldb/Host/Socket.h b/lldb/include/lldb/Host/Socket.h index 0fae2c627b9..0981808a7d0 100644 --- a/lldb/include/lldb/Host/Socket.h +++ b/lldb/include/lldb/Host/Socket.h @@ -39,12 +39,12 @@ typedef int NativeSocket; class Socket : public IOObject { public: - typedef enum { + enum SocketProtocol { ProtocolTcp, ProtocolUdp, ProtocolUnixDomain, ProtocolUnixAbstract - } SocketProtocol; + }; static const NativeSocket kInvalidSocketValue; diff --git a/lldb/include/lldb/Interpreter/CommandCompletions.h b/lldb/include/lldb/Interpreter/CommandCompletions.h index 64544caf8fe..3d09db5ce5e 100644 --- a/lldb/include/lldb/Interpreter/CommandCompletions.h +++ b/lldb/include/lldb/Interpreter/CommandCompletions.h @@ -30,7 +30,7 @@ public: CompletionRequest &request, // A search filter to limit the search... lldb_private::SearchFilter *searcher); - typedef enum { + enum CommonCompletionTypes { eNoCompletion = 0u, eSourceFileCompletion = (1u << 0), eDiskFileCompletion = (1u << 1), @@ -45,7 +45,7 @@ public: // you can add custom enums starting from here in your Option class. Also // if you & in this bit the base code will not process the option. eCustomCompletion = (1u << 9) - } CommonCompletionTypes; + }; struct CommonCompletionElement { uint32_t type; diff --git a/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h b/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h index 0d6ec24cf7c..3729c000b8e 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h +++ b/lldb/include/lldb/Interpreter/OptionGroupWatchpoint.h @@ -34,12 +34,12 @@ public: // Note: // eWatchRead == LLDB_WATCH_TYPE_READ; and // eWatchWrite == LLDB_WATCH_TYPE_WRITE - typedef enum WatchType { + enum WatchType { eWatchInvalid = 0, eWatchRead, eWatchWrite, eWatchReadWrite - } WatchType; + }; WatchType watch_type; uint32_t watch_size; diff --git a/lldb/include/lldb/Interpreter/OptionValue.h b/lldb/include/lldb/Interpreter/OptionValue.h index cb0fbfbb9a1..0b85bc19dd2 100644 --- a/lldb/include/lldb/Interpreter/OptionValue.h +++ b/lldb/include/lldb/Interpreter/OptionValue.h @@ -22,7 +22,7 @@ namespace lldb_private { // OptionValue class OptionValue { public: - typedef enum { + enum Type { eTypeInvalid = 0, eTypeArch, eTypeArgs, @@ -43,7 +43,7 @@ public: eTypeUInt64, eTypeUUID, eTypeFormatEntity - } Type; + }; enum { eDumpOptionName = (1u << 0), diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h index aff4da4e77f..c8fa3901350 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h @@ -34,7 +34,7 @@ private: class ScriptInterpreter : public PluginInterface { public: - typedef enum { + enum ScriptReturnType { eScriptReturnTypeCharPtr, eScriptReturnTypeBool, eScriptReturnTypeShortInt, @@ -50,7 +50,7 @@ public: eScriptReturnTypeChar, eScriptReturnTypeCharStrOrNone, eScriptReturnTypeOpaqueObject - } ScriptReturnType; + }; ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang); diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h index e5c5285c6a7..ea7825a5e5a 100644 --- a/lldb/include/lldb/Symbol/ObjectFile.h +++ b/lldb/include/lldb/Symbol/ObjectFile.h @@ -61,7 +61,7 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>, friend class lldb_private::Module; public: - typedef enum { + enum Type { eTypeInvalid = 0, eTypeCoreFile, /// A core file that has a checkpoint of a program's /// execution state @@ -74,16 +74,16 @@ public: /// execution eTypeJIT, /// JIT code that has symbols, sections and possibly debug info eTypeUnknown - } Type; + }; - typedef enum { + enum Strata { eStrataInvalid = 0, eStrataUnknown, eStrataUser, eStrataKernel, eStrataRawImage, eStrataJIT - } Strata; + }; struct LoadableData { lldb::addr_t Dest; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 10f52f1075e..92c3f3a2cd5 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -351,7 +351,7 @@ public: class SymbolContextSpecifier { public: - typedef enum SpecificationType { + enum SpecificationType { eNothingSpecified = 0, eModuleSpecified = 1 << 0, eFileSpecified = 1 << 1, @@ -360,7 +360,7 @@ public: eFunctionSpecified = 1 << 4, eClassOrNamespaceSpecified = 1 << 5, eAddressRangeSpecified = 1 << 6 - } SpecificationType; + }; // This one produces a specifier that matches everything... SymbolContextSpecifier(const lldb::TargetSP &target_sp); diff --git a/lldb/include/lldb/Symbol/Symtab.h b/lldb/include/lldb/Symbol/Symtab.h index 1f2cd8f89ee..eda5f985823 100644 --- a/lldb/include/lldb/Symbol/Symtab.h +++ b/lldb/include/lldb/Symbol/Symtab.h @@ -23,17 +23,13 @@ public: typedef std::vector<uint32_t> IndexCollection; typedef UniqueCStringMap<uint32_t> NameToIndexMap; - typedef enum Debug { + enum Debug { eDebugNo, // Not a debug symbol eDebugYes, // A debug symbol eDebugAny - } Debug; + }; - typedef enum Visibility { - eVisibilityAny, - eVisibilityExtern, - eVisibilityPrivate - } Visibility; + enum Visibility { eVisibilityAny, eVisibilityExtern, eVisibilityPrivate }; Symtab(ObjectFile *objfile); ~Symtab(); diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index f1b094ad271..d38210d2f93 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -59,25 +59,25 @@ protected: class Type : public std::enable_shared_from_this<Type>, public UserID { public: - typedef enum EncodingDataTypeTag { + enum EncodingDataType { eEncodingInvalid, eEncodingIsUID, ///< This type is the type whose UID is m_encoding_uid eEncodingIsConstUID, ///< This type is the type whose UID is m_encoding_uid - ///with the const qualifier added + /// with the const qualifier added eEncodingIsRestrictUID, ///< This type is the type whose UID is - ///m_encoding_uid with the restrict qualifier added + /// m_encoding_uid with the restrict qualifier added eEncodingIsVolatileUID, ///< This type is the type whose UID is - ///m_encoding_uid with the volatile qualifier added + /// m_encoding_uid with the volatile qualifier added eEncodingIsTypedefUID, ///< This type is pointer to a type whose UID is - ///m_encoding_uid + /// m_encoding_uid eEncodingIsPointerUID, ///< This type is pointer to a type whose UID is - ///m_encoding_uid + /// m_encoding_uid eEncodingIsLValueReferenceUID, ///< This type is L value reference to a type - ///whose UID is m_encoding_uid + /// whose UID is m_encoding_uid eEncodingIsRValueReferenceUID, ///< This type is R value reference to a type - ///whose UID is m_encoding_uid + /// whose UID is m_encoding_uid eEncodingIsSyntheticUID - } EncodingDataType; + }; // We must force the underlying type of the enum to be unsigned here. Not // all compilers behave the same with regards to the default underlying type diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 19643b992cb..e3110f7f87e 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -2509,11 +2509,11 @@ protected: // RequestResume, don't call Resume directly. class NextEventAction { public: - typedef enum EventActionResult { + enum EventActionResult { eEventActionSuccess, eEventActionRetry, eEventActionExit - } EventActionResult; + }; NextEventAction(Process *process) : m_process(process) {} diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index ca88763ba43..875a8b1e2c1 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -38,29 +38,29 @@ namespace lldb_private { OptionEnumValues GetDynamicValueTypes(); -typedef enum InlineStrategy { +enum InlineStrategy { eInlineBreakpointsNever = 0, eInlineBreakpointsHeaders, eInlineBreakpointsAlways -} InlineStrategy; +}; -typedef enum LoadScriptFromSymFile { +enum LoadScriptFromSymFile { eLoadScriptFromSymFileTrue, eLoadScriptFromSymFileFalse, eLoadScriptFromSymFileWarn -} LoadScriptFromSymFile; +}; -typedef enum LoadCWDlldbinitFile { +enum LoadCWDlldbinitFile { eLoadCWDlldbinitTrue, eLoadCWDlldbinitFalse, eLoadCWDlldbinitWarn -} LoadCWDlldbinitFile; +}; -typedef enum LoadDependentFiles { +enum LoadDependentFiles { eLoadDependentsDefault, eLoadDependentsYes, eLoadDependentsNo, -} LoadDependentFiles; +}; // TargetProperties class TargetExperimentalProperties : public Properties { diff --git a/lldb/include/lldb/Target/ThreadPlan.h b/lldb/include/lldb/Target/ThreadPlan.h index dd6766b6821..ff87ed23cda 100644 --- a/lldb/include/lldb/Target/ThreadPlan.h +++ b/lldb/include/lldb/Target/ThreadPlan.h @@ -331,11 +331,11 @@ namespace lldb_private { class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>, public UserID { public: - typedef enum { eAllThreads, eSomeThreads, eThisThread } ThreadScope; + enum ThreadScope { eAllThreads, eSomeThreads, eThisThread }; // We use these enums so that we can cast a base thread plan to it's real // type without having to resort to dynamic casting. - typedef enum { + enum ThreadPlanKind { eKindGeneric, eKindNull, eKindBase, @@ -351,7 +351,7 @@ public: eKindStepUntil, eKindTestCondition - } ThreadPlanKind; + }; // Constructors and Destructors ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, diff --git a/lldb/include/lldb/Target/ThreadPlanTracer.h b/lldb/include/lldb/Target/ThreadPlanTracer.h index 40d4e17dd10..80b08078e97 100644 --- a/lldb/include/lldb/Target/ThreadPlanTracer.h +++ b/lldb/include/lldb/Target/ThreadPlanTracer.h @@ -21,12 +21,12 @@ class ThreadPlanTracer { friend class ThreadPlan; public: - typedef enum ThreadPlanTracerStyle { + enum ThreadPlanTracerStyle { eLocation = 0, eStateChange, eCheckFrames, ePython - } ThreadPlanTracerStyle; + }; ThreadPlanTracer(Thread &thread, lldb::StreamSP &stream_sp); ThreadPlanTracer(Thread &thread); diff --git a/lldb/include/lldb/Utility/DataExtractor.h b/lldb/include/lldb/Utility/DataExtractor.h index 355500467df..52c93b1ed48 100644 --- a/lldb/include/lldb/Utility/DataExtractor.h +++ b/lldb/include/lldb/Utility/DataExtractor.h @@ -48,7 +48,7 @@ class DataExtractor { public: /// \typedef DataExtractor::Type /// Type enumerations used in the dump routines. - typedef enum { + enum Type { TypeUInt8, ///< Format output as unsigned 8 bit integers TypeChar, ///< Format output as characters TypeUInt16, ///< Format output as unsigned 16 bit integers @@ -57,7 +57,7 @@ public: TypePointer, ///< Format output as pointers TypeULEB128, ///< Format output as ULEB128 numbers TypeSLEB128 ///< Format output as SLEB128 numbers - } Type; + }; /// Default constructor. /// diff --git a/lldb/include/lldb/Utility/IOObject.h b/lldb/include/lldb/Utility/IOObject.h index 9199ddbb579..1640200a01d 100644 --- a/lldb/include/lldb/Utility/IOObject.h +++ b/lldb/include/lldb/Utility/IOObject.h @@ -19,10 +19,10 @@ namespace lldb_private { class IOObject { public: - typedef enum { + enum FDType { eFDTypeFile, // Other FD requiring read/write eFDTypeSocket, // Socket requiring send/recv - } FDType; + }; // TODO: On Windows this should be a HANDLE, and wait should use // WaitForMultipleObjects diff --git a/lldb/include/lldb/Utility/Predicate.h b/lldb/include/lldb/Utility/Predicate.h index 87298a99999..f1539b57668 100644 --- a/lldb/include/lldb/Utility/Predicate.h +++ b/lldb/include/lldb/Utility/Predicate.h @@ -23,12 +23,12 @@ /// Enumerations for broadcasting. namespace lldb_private { -typedef enum { +enum PredicateBroadcastType { eBroadcastNever, ///< No broadcast will be sent when the value is modified. eBroadcastAlways, ///< Always send a broadcast when the value is modified. eBroadcastOnChange ///< Only broadcast if the value changes when the value is /// modified. -} PredicateBroadcastType; +}; /// \class Predicate Predicate.h "lldb/Utility/Predicate.h" /// A C++ wrapper class for providing threaded access to a value of diff --git a/lldb/include/lldb/lldb-private-enumerations.h b/lldb/include/lldb/lldb-private-enumerations.h index e494ea8b5e8..3d8b360fb30 100644 --- a/lldb/include/lldb/lldb-private-enumerations.h +++ b/lldb/include/lldb/lldb-private-enumerations.h @@ -16,7 +16,7 @@ namespace lldb_private { // Thread Step Types -typedef enum StepType { +enum StepType { eStepTypeNone, eStepTypeTrace, ///< Single step one instruction. eStepTypeTraceOver, ///< Single step one instruction, stepping over. @@ -24,18 +24,18 @@ typedef enum StepType { eStepTypeOver, ///< Single step over a specified context. eStepTypeOut, ///< Single step out a specified context. eStepTypeScripted ///< A step type implemented by the script interpreter. -} StepType; +}; // Address Types -typedef enum AddressType { +enum AddressType { eAddressTypeInvalid = 0, eAddressTypeFile, ///< Address is an address as found in an object or symbol - ///file + /// file eAddressTypeLoad, ///< Address is an address as in the current target inferior - ///process + /// process eAddressTypeHost ///< Address is an address in the process that is running - ///this code -} AddressType; + /// this code +}; // Address Class // @@ -56,15 +56,15 @@ enum class AddressClass { }; // Votes - Need a tri-state, yes, no, no opinion... -typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote; +enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 }; -typedef enum ArchitectureType { +enum ArchitectureType { eArchTypeInvalid, eArchTypeMachO, eArchTypeELF, eArchTypeCOFF, kNumArchTypes -} ArchitectureType; +}; /// Settable state variable types. /// @@ -80,7 +80,7 @@ typedef enum ArchitectureType { // eSetVarTypeNone //} SettableVariableType; -typedef enum VarSetOperationType { +enum VarSetOperationType { eVarSetOperationReplace, eVarSetOperationInsertBefore, eVarSetOperationInsertAfter, @@ -89,9 +89,9 @@ typedef enum VarSetOperationType { eVarSetOperationClear, eVarSetOperationAssign, eVarSetOperationInvalid -} VarSetOperationType; +}; -typedef enum ArgumentRepetitionType { +enum ArgumentRepetitionType { eArgRepeatPlain, // Exactly one occurrence eArgRepeatOptional, // At most one occurrence, but it's optional eArgRepeatPlus, // One or more occurrences @@ -105,25 +105,17 @@ typedef enum ArgumentRepetitionType { eArgRepeatPairRange, // A pair that repeats from 1 to n eArgRepeatPairRangeOptional // A pair that repeats from 1 to n, but is // optional -} ArgumentRepetitionType; +}; -typedef enum SortOrder { - eSortOrderNone, - eSortOrderByAddress, - eSortOrderByName -} SortOrder; +enum SortOrder { eSortOrderNone, eSortOrderByAddress, eSortOrderByName }; // LazyBool is for boolean values that need to be calculated lazily. Values // start off set to eLazyBoolCalculate, and then they can be calculated once // and set to eLazyBoolNo or eLazyBoolYes. -typedef enum LazyBool { - eLazyBoolCalculate = -1, - eLazyBoolNo = 0, - eLazyBoolYes = 1 -} LazyBool; +enum LazyBool { eLazyBoolCalculate = -1, eLazyBoolNo = 0, eLazyBoolYes = 1 }; /// Instruction types -typedef enum InstructionType { +enum InstructionType { eInstructionTypeAny, // Support for any instructions at all (at least one) eInstructionTypePrologueEpilogue, // All prologue and epilogue instructions // that push and pop register values and @@ -132,10 +124,10 @@ typedef enum InstructionType { // counter/instruction pointer eInstructionTypeAll // All instructions of any kind -} InstructionType; +}; /// Format category entry types -typedef enum FormatCategoryItem { +enum FormatCategoryItem { eFormatCategoryItemSummary = 0x0001, eFormatCategoryItemRegexSummary = 0x0002, eFormatCategoryItemFilter = 0x0004, @@ -146,18 +138,18 @@ typedef enum FormatCategoryItem { eFormatCategoryItemRegexValue = 0x0080, eFormatCategoryItemValidator = 0x0100, eFormatCategoryItemRegexValidator = 0x0200 -} FormatCategoryItem; +}; /// Expression execution policies -typedef enum { +enum ExecutionPolicy { eExecutionPolicyOnlyWhenNeeded, eExecutionPolicyNever, eExecutionPolicyAlways, eExecutionPolicyTopLevel // used for top-level code -} ExecutionPolicy; +}; // Ways that the FormatManager picks a particular format for a type -typedef enum FormatterChoiceCriterion { +enum FormatterChoiceCriterion { eFormatterChoiceCriterionDirectChoice = 0x00000000, eFormatterChoiceCriterionStrippedPointerReference = 0x00000001, eFormatterChoiceCriterionNavigatedTypedefs = 0x00000002, @@ -166,31 +158,31 @@ typedef enum FormatterChoiceCriterion { eFormatterChoiceCriterionLanguagePlugin = 0x00000008, eFormatterChoiceCriterionStrippedBitField = 0x00000010, eFormatterChoiceCriterionWentToStaticValue = 0x00000020 -} FormatterChoiceCriterion; +}; // Synchronicity behavior of scripted commands -typedef enum ScriptedCommandSynchronicity { +enum ScriptedCommandSynchronicity { eScriptedCommandSynchronicitySynchronous, eScriptedCommandSynchronicityAsynchronous, eScriptedCommandSynchronicityCurrentValue // use whatever the current // synchronicity is -} ScriptedCommandSynchronicity; +}; // Verbosity mode of "po" output -typedef enum LanguageRuntimeDescriptionDisplayVerbosity { +enum LanguageRuntimeDescriptionDisplayVerbosity { eLanguageRuntimeDescriptionDisplayVerbosityCompact, // only print the // description string, if // any eLanguageRuntimeDescriptionDisplayVerbosityFull, // print the full-blown // output -} LanguageRuntimeDescriptionDisplayVerbosity; +}; // Loading modules from memory -typedef enum MemoryModuleLoadLevel { +enum MemoryModuleLoadLevel { eMemoryModuleLoadLevelMinimal, // Load sections only eMemoryModuleLoadLevelPartial, // Load function bounds but no symbols eMemoryModuleLoadLevelComplete, // Load sections and all symbols -} MemoryModuleLoadLevel; +}; // Result enums for when reading multiple lines from IOHandlers enum class LineStatus { diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/cast_int_to_anonymous_enum/main.cpp b/lldb/packages/Python/lldbsuite/test/expression_command/cast_int_to_anonymous_enum/main.cpp index 7b5c5b24362..7ae4c1735db 100644 --- a/lldb/packages/Python/lldbsuite/test/expression_command/cast_int_to_anonymous_enum/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/expression_command/cast_int_to_anonymous_enum/main.cpp @@ -1,6 +1,6 @@ -typedef enum { +enum flow_e { A=0, -} flow_e; +}; int main() { flow_e f; diff --git a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/main.cpp b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/main.cpp index eb4969d4108..6823ccc4eb8 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/main.cpp @@ -22,11 +22,11 @@ std::thread g_thread_2; std::thread g_thread_3; std::mutex g_mask_mutex; -typedef enum { +enum MaskAction { eGet, eAssign, eClearBits -} MaskAction; +}; uint32_t mask_access (MaskAction action, uint32_t mask = 0); diff --git a/lldb/packages/Python/lldbsuite/test/python_api/module_section/main.cpp b/lldb/packages/Python/lldbsuite/test/python_api/module_section/main.cpp index da94b2714a2..c2dc68c38fd 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/module_section/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/python_api/module_section/main.cpp @@ -22,11 +22,11 @@ std::thread g_thread_2; std::thread g_thread_3; std::mutex g_mask_mutex; -typedef enum { +enum MaskAction { eGet, eAssign, eClearBits -} MaskAction; +}; uint32_t mask_access (MaskAction action, uint32_t mask = 0); diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index d4ec326fbc4..a4f558e7f81 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -324,7 +324,7 @@ static constexpr OptionDefinition g_breakpoint_set_options[] = { class CommandObjectBreakpointSet : public CommandObjectParsed { public: - typedef enum BreakpointSetType { + enum BreakpointSetType { eSetTypeInvalid, eSetTypeFileAndLine, eSetTypeAddress, @@ -333,7 +333,7 @@ public: eSetTypeSourceRegexp, eSetTypeException, eSetTypeScripted, - } BreakpointSetType; + }; CommandObjectBreakpointSet(CommandInterpreter &interpreter) : CommandObjectParsed( @@ -1420,10 +1420,7 @@ static constexpr OptionDefinition g_breakpoint_clear_options[] = { class CommandObjectBreakpointClear : public CommandObjectParsed { public: - typedef enum BreakpointClearType { - eClearTypeInvalid, - eClearTypeFileAndLine - } BreakpointClearType; + enum BreakpointClearType { eClearTypeInvalid, eClearTypeFileAndLine }; CommandObjectBreakpointClear(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "breakpoint clear", diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h index 2254d3c213c..13d7fc061be 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.h @@ -45,7 +45,7 @@ private: class EmulateInstructionARM : public EmulateInstruction { public: - typedef enum { + enum ARMEncoding { eEncodingA1, eEncodingA2, eEncodingA3, @@ -56,7 +56,7 @@ public: eEncodingT3, eEncodingT4, eEncodingT5 - } ARMEncoding; + }; static void Initialize(); @@ -291,7 +291,7 @@ public: protected: // Typedef for the callback function used during the emulation. // Pass along (ARMEncoding)encoding as the callback data. - typedef enum { eSize16, eSize32 } ARMInstrSize; + enum ARMInstrSize { eSize16, eSize32 }; typedef struct { uint32_t mask; diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h index 22123bfe933..03a57a2cf92 100644 --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h @@ -73,25 +73,25 @@ public: bool CreateFunctionEntryUnwind(lldb_private::UnwindPlan &unwind_plan) override; - typedef enum { AddrMode_OFF, AddrMode_PRE, AddrMode_POST } AddrMode; + enum AddrMode { AddrMode_OFF, AddrMode_PRE, AddrMode_POST }; - typedef enum { + enum BranchType { BranchType_CALL, BranchType_ERET, BranchType_DRET, BranchType_RET, BranchType_JMP - } BranchType; + }; - typedef enum { CountOp_CLZ, CountOp_CLS, CountOp_CNT } CountOp; + enum CountOp { CountOp_CLZ, CountOp_CLS, CountOp_CNT }; - typedef enum { RevOp_RBIT, RevOp_REV16, RevOp_REV32, RevOp_REV64 } RevOp; + enum RevOp { RevOp_RBIT, RevOp_REV16, RevOp_REV32, RevOp_REV64 }; - typedef enum { BitwiseOp_NOT, BitwiseOp_RBIT } BitwiseOp; + enum BitwiseOp { BitwiseOp_NOT, BitwiseOp_RBIT }; - typedef enum { EL0 = 0, EL1 = 1, EL2 = 2, EL3 = 3 } ExceptionLevel; + enum ExceptionLevel { EL0 = 0, EL1 = 1, EL2 = 2, EL3 = 3 }; - typedef enum { + enum ExtendType { ExtendType_SXTB, ExtendType_SXTH, ExtendType_SXTW, @@ -100,44 +100,36 @@ public: ExtendType_UXTH, ExtendType_UXTW, ExtendType_UXTX - } ExtendType; + }; - typedef enum { ExtractType_LEFT, ExtractType_RIGHT } ExtractType; + enum ExtractType { ExtractType_LEFT, ExtractType_RIGHT }; - typedef enum { LogicalOp_AND, LogicalOp_EOR, LogicalOp_ORR } LogicalOp; + enum LogicalOp { LogicalOp_AND, LogicalOp_EOR, LogicalOp_ORR }; - typedef enum { MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH, MemOp_NOP } MemOp; + enum MemOp { MemOp_LOAD, MemOp_STORE, MemOp_PREFETCH, MemOp_NOP }; - typedef enum { MoveWideOp_N, MoveWideOp_Z, MoveWideOp_K } MoveWideOp; + enum MoveWideOp { MoveWideOp_N, MoveWideOp_Z, MoveWideOp_K }; - typedef enum { - ShiftType_LSL, - ShiftType_LSR, - ShiftType_ASR, - ShiftType_ROR - } ShiftType; + enum ShiftType { ShiftType_LSL, ShiftType_LSR, ShiftType_ASR, ShiftType_ROR }; - typedef enum { SP0 = 0, SPx = 1 } StackPointerSelection; + enum StackPointerSelection { SP0 = 0, SPx = 1 }; - typedef enum { - Unpredictable_WBOVERLAP, - Unpredictable_LDPOVERLAP - } Unpredictable; + enum Unpredictable { Unpredictable_WBOVERLAP, Unpredictable_LDPOVERLAP }; - typedef enum { + enum ConstraintType { Constraint_NONE, Constraint_UNKNOWN, Constraint_SUPPRESSWB, Constraint_NOP - } ConstraintType; + }; - typedef enum { + enum AccType { AccType_NORMAL, AccType_UNPRIV, AccType_STREAM, AccType_ALIGNED, AccType_ORDERED - } AccType; + }; typedef struct { uint32_t N : 1, V : 1, C : 1, diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp index 890d9f996be..140d09ed43c 100644 --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -35,11 +35,7 @@ using namespace lldb; using namespace lldb_private; // Debug Interface Structures -typedef enum { - JIT_NOACTION = 0, - JIT_REGISTER_FN, - JIT_UNREGISTER_FN -} jit_actions_t; +enum jit_actions_t { JIT_NOACTION = 0, JIT_REGISTER_FN, JIT_UNREGISTER_FN }; template <typename ptr_t> struct jit_code_entry { ptr_t next_entry; // pointer diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h index a172c54ebf2..f1356afe6df 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h @@ -36,7 +36,7 @@ public: struct DispatchFunction { public: - typedef enum { eFixUpNone, eFixUpFixed, eFixUpToFix } FixUpState; + enum FixUpState { eFixUpNone, eFixUpFixed, eFixUpToFix }; const char *name; bool stret_return; diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h index 9b696de9a47..93edaa72b81 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h @@ -16,7 +16,7 @@ class ObjectFilePECOFF : public lldb_private::ObjectFile { public: - typedef enum MachineType { + enum MachineType { MachineUnknown = 0x0, MachineAm33 = 0x1d3, MachineAmd64 = 0x8664, @@ -39,7 +39,7 @@ public: MachineSh5 = 0x1a8, MachineThumb = 0x1c2, MachineWcemIpsv2 = 0x169 - } MachineType; + }; ObjectFilePECOFF(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, @@ -206,10 +206,10 @@ protected: data_dirs; // will contain num_data_dir_entries entries } coff_opt_header_t; - typedef enum coff_data_dir_type { + enum coff_data_dir_type { coff_data_dir_export_table = 0, coff_data_dir_import_table = 1, - } coff_data_dir_type; + }; typedef struct section_header { char name[8]; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h index fed6128c17f..47013c97209 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h @@ -26,7 +26,7 @@ public: const static uint32_t kMaxPacketSize = 1200; const static uint32_t kMaxDataSize = 1024; typedef lldb_private::StreamBuffer<1024> PacketStreamType; - typedef enum { + enum CommandType { KDP_CONNECT = 0u, KDP_DISCONNECT, KDP_HOSTINFO, @@ -59,23 +59,23 @@ public: KDP_READMSR64, KDP_WRITEMSR64, KDP_DUMPINFO - } CommandType; + }; enum { KDP_FEATURE_BP = (1u << 0) }; - typedef enum { + enum KDPError { KDP_PROTERR_SUCCESS = 0, KDP_PROTERR_ALREADY_CONNECTED, KDP_PROTERR_BAD_NBYTES, KDP_PROTERR_BADFLAVOR - } KDPError; + }; - typedef enum { + enum PacketType { ePacketTypeRequest = 0x00u, ePacketTypeReply = 0x80u, ePacketTypeMask = 0x80u, eCommandTypeMask = 0x7fu - } PacketType; + }; // Constructors and Destructors CommunicationKDP(const char *comm_name); diff --git a/lldb/source/Plugins/Process/Utility/ARMDefines.h b/lldb/source/Plugins/Process/Utility/ARMDefines.h index 87f77b93299..1f7eb54d10e 100644 --- a/lldb/source/Plugins/Process/Utility/ARMDefines.h +++ b/lldb/source/Plugins/Process/Utility/ARMDefines.h @@ -19,14 +19,14 @@ namespace lldb_private { // ARM shifter types -typedef enum { +enum ARM_ShifterType { SRType_LSL, SRType_LSR, SRType_ASR, SRType_ROR, SRType_RRX, SRType_Invalid -} ARM_ShifterType; +}; // ARM conditions // Meaning (integer) Meaning (floating-point) // Condition flags diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index e3dc9d2d1d7..bb777a5c26a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -29,14 +29,14 @@ namespace lldb_private { namespace process_gdb_remote { -typedef enum { +enum GDBStoppointType { eStoppointInvalid = -1, eBreakpointSoftware = 0, eBreakpointHardware, eWatchpointWrite, eWatchpointRead, eWatchpointReadWrite -} GDBStoppointType; +}; enum class CompressionType { None = 0, // no compression diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h index 3e446f67e12..e6b1256b11a 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h @@ -88,10 +88,7 @@ protected: private: bool GetDynamicLoaderAddress(lldb::addr_t addr); - typedef enum CorefilePreference { - eUserProcessCorefile, - eKernelCorefile - } CorefilePreferences; + enum CorefilePreference { eUserProcessCorefile, eKernelCorefile }; /// If a core file can be interpreted multiple ways, this establishes /// which style wins. diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 58f23251305..fd54d4062df 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -3252,11 +3252,11 @@ static constexpr OptionEnumValueElement g_inline_breakpoint_enums[] = { "Always look for inline breakpoint locations when setting file and line " "breakpoints (slower but most accurate)."} }; -typedef enum x86DisassemblyFlavor { +enum x86DisassemblyFlavor { eX86DisFlavorDefault, eX86DisFlavorIntel, eX86DisFlavorATT -} x86DisassemblyFlavor; +}; static constexpr OptionEnumValueElement g_x86_dis_flavor_value_types[] = { {eX86DisFlavorDefault, "default", "Disassembler default (currently att)."}, diff --git a/lldb/tools/debugserver/source/DNBDataRef.h b/lldb/tools/debugserver/source/DNBDataRef.h index ecba580fbde..d521700d151 100644 --- a/lldb/tools/debugserver/source/DNBDataRef.h +++ b/lldb/tools/debugserver/source/DNBDataRef.h @@ -31,7 +31,7 @@ class DNBDataRef { public: // For use with Dump - typedef enum { + enum Type { TypeUInt8 = 0, TypeChar, TypeUInt16, @@ -40,7 +40,7 @@ public: TypePointer, TypeULEB128, TypeSLEB128 - } Type; + }; typedef uint32_t offset_t; typedef nub_addr_t addr_t; diff --git a/lldb/tools/debugserver/source/DNBDefs.h b/lldb/tools/debugserver/source/DNBDefs.h index 3ff60d313aa..cd61b31d619 100644 --- a/lldb/tools/debugserver/source/DNBDefs.h +++ b/lldb/tools/debugserver/source/DNBDefs.h @@ -64,7 +64,7 @@ typedef uint32_t nub_bool_t; #define WATCH_TYPE_READ (1u << 0) #define WATCH_TYPE_WRITE (1u << 1) -typedef enum { +enum nub_state_t { eStateInvalid = 0, eStateUnloaded, eStateAttaching, @@ -76,9 +76,9 @@ typedef enum { eStateDetached, eStateExited, eStateSuspended -} nub_state_t; +}; -typedef enum { +enum nub_launch_flavor_t { eLaunchFlavorDefault = 0, eLaunchFlavorPosixSpawn = 1, eLaunchFlavorForkExec = 2, @@ -91,7 +91,7 @@ typedef enum { #ifdef WITH_FBS eLaunchFlavorFBS = 5 #endif -} nub_launch_flavor_t; +}; #define NUB_STATE_IS_RUNNING(s) \ ((s) == eStateAttaching || (s) == eStateLaunching || (s) == eStateRunning || \ diff --git a/lldb/tools/debugserver/source/DNBError.h b/lldb/tools/debugserver/source/DNBError.h index 2ca2d41de8e..7e67cf2c553 100644 --- a/lldb/tools/debugserver/source/DNBError.h +++ b/lldb/tools/debugserver/source/DNBError.h @@ -21,7 +21,7 @@ class DNBError { public: typedef uint32_t ValueType; - typedef enum { + enum FlavorType { Generic = 0, MachKernel = 1, POSIX = 2 @@ -37,7 +37,7 @@ public: , FrontBoard = 5 #endif - } FlavorType; + }; explicit DNBError(ValueType err = 0, FlavorType flavor = Generic) : m_err(err), m_flavor(flavor) {} diff --git a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h index 0bc1b50cdf9..4bb899b4503 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h +++ b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h @@ -113,14 +113,14 @@ protected: nub_addr_t *nextPC, bool *nextPCIsThumb); - typedef enum RegisterSetTag { + enum RegisterSet { e_regSetALL = REGISTER_SET_ALL, e_regSetGPR, // ARM_THREAD_STATE e_regSetVFP, // ARM_VFP_STATE (ARM_NEON_STATE if defined __arm64__) e_regSetEXC, // ARM_EXCEPTION_STATE e_regSetDBG, // ARM_DEBUG_STATE (ARM_DEBUG_STATE32 if defined __arm64__) kNumRegisterSets - } RegisterSet; + }; enum { Read = 0, Write = 1, kNumErrors = 2 }; diff --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h index dc44cd2d086..2c59a0ceb5d 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h +++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h @@ -75,14 +75,14 @@ protected: kern_return_t EnableHardwareSingleStep(bool enable); static bool FixGenericRegisterNumber(uint32_t &set, uint32_t ®); - typedef enum RegisterSetTag { + enum RegisterSet { e_regSetALL = REGISTER_SET_ALL, e_regSetGPR, // ARM_THREAD_STATE64, e_regSetVFP, // ARM_NEON_STATE64, e_regSetEXC, // ARM_EXCEPTION_STATE64, e_regSetDBG, // ARM_DEBUG_STATE64, kNumRegisterSets - } RegisterSet; + }; enum { e_regSetGPRCount = ARM_THREAD_STATE64_COUNT, diff --git a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h index 80b3c1c5919..12b515a2957 100644 --- a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h +++ b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h @@ -88,23 +88,23 @@ protected: static const size_t k_num_fpu_registers_avx512f; static const size_t k_num_all_registers_avx512f; - typedef enum RegisterSetTag { + enum RegisterSet { e_regSetALL = REGISTER_SET_ALL, e_regSetGPR, e_regSetFPU, e_regSetEXC, e_regSetDBG, kNumRegisterSets - } RegisterSet; + }; - typedef enum RegisterSetWordSizeTag { + enum RegisterSetWordSize { e_regSetWordSizeGPR = sizeof(GPR) / sizeof(int), e_regSetWordSizeFPU = sizeof(FPU) / sizeof(int), e_regSetWordSizeEXC = sizeof(EXC) / sizeof(int), e_regSetWordSizeAVX = sizeof(AVX) / sizeof(int), e_regSetWordSizeAVX512f = sizeof(AVX512F) / sizeof(int), e_regSetWordSizeDBG = sizeof(DBG) / sizeof(int) - } RegisterSetWordSize; + }; enum { Read = 0, Write = 1, kNumErrors = 2 }; diff --git a/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h b/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h index f9c094b9189..7d20f18d027 100644 --- a/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h +++ b/lldb/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h @@ -45,14 +45,14 @@ public: protected: kern_return_t EnableHardwareSingleStep(bool enable); - typedef enum RegisterSetTag { + enum RegisterSet { e_regSetALL = REGISTER_SET_ALL, e_regSetGPR, e_regSetFPR, e_regSetEXC, e_regSetVEC, kNumRegisterSets - } RegisterSet; + }; typedef enum RegisterSetWordSizeTag { e_regSetWordSizeGPR = PPC_THREAD_STATE_COUNT, diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h index 2ec254de7f2..62ce37d4c04 100644 --- a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h +++ b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h @@ -87,23 +87,23 @@ protected: static const size_t k_num_fpu_registers_avx512f; static const size_t k_num_all_registers_avx512f; - typedef enum RegisterSetTag { + enum RegisterSet { e_regSetALL = REGISTER_SET_ALL, e_regSetGPR, e_regSetFPU, e_regSetEXC, e_regSetDBG, kNumRegisterSets - } RegisterSet; + }; - typedef enum RegisterSetWordSizeTag { + enum RegisterSetWordSize { e_regSetWordSizeGPR = sizeof(GPR) / sizeof(int), e_regSetWordSizeFPU = sizeof(FPU) / sizeof(int), e_regSetWordSizeEXC = sizeof(EXC) / sizeof(int), e_regSetWordSizeAVX = sizeof(AVX) / sizeof(int), e_regSetWordSizeAVX512f = sizeof(AVX512F) / sizeof(int), e_regSetWordSizeDBG = sizeof(DBG) / sizeof(int) - } RegisterSetWordSize; + }; enum { Read = 0, Write = 1, kNumErrors = 2 }; diff --git a/lldb/tools/debugserver/source/RNBDefs.h b/lldb/tools/debugserver/source/RNBDefs.h index fbd51f499bf..4cc7c220b7f 100644 --- a/lldb/tools/debugserver/source/RNBDefs.h +++ b/lldb/tools/debugserver/source/RNBDefs.h @@ -75,7 +75,7 @@ extern "C" const double CONCAT(DEBUGSERVER_PROGRAM_SYMBOL, VersionNumber); class RNBRemote; typedef std::shared_ptr<RNBRemote> RNBRemoteSP; -typedef enum { rnb_success = 0, rnb_err = 1, rnb_not_connected = 2 } rnb_err_t; +enum rnb_err_t { rnb_success = 0, rnb_err = 1, rnb_not_connected = 2 }; // Log bits // reserve low bits for DNB diff --git a/lldb/tools/debugserver/source/RNBRemote.h b/lldb/tools/debugserver/source/RNBRemote.h index d59f42af0be..1fb309bbc44 100644 --- a/lldb/tools/debugserver/source/RNBRemote.h +++ b/lldb/tools/debugserver/source/RNBRemote.h @@ -33,7 +33,7 @@ enum class compression_types { zlib_deflate, lz4, lzma, lzfse, none }; class RNBRemote { public: - typedef enum { + enum PacketEnum { invalid_packet = 0, ack, // '+' nack, // '-' @@ -138,7 +138,7 @@ public: query_supported_async_json_packets, // 'QSupportedAsyncJSONPackets' configure_darwin_log, // 'ConfigureDarwinLog:' unknown_type - } PacketEnum; + }; typedef rnb_err_t (RNBRemote::*HandlePacketCallback)(const char *p); diff --git a/lldb/tools/debugserver/source/debugserver.cpp b/lldb/tools/debugserver/source/debugserver.cpp index 1463ff906cf..5a0681847a8 100644 --- a/lldb/tools/debugserver/source/debugserver.cpp +++ b/lldb/tools/debugserver/source/debugserver.cpp @@ -46,7 +46,7 @@ extern "C" int proc_set_wakemon_params(pid_t, int, nub_process_t g_pid = INVALID_NUB_PROCESS; // Run loop modes which determine which run loop function will be called -typedef enum { +enum RNBRunLoopMode { eRNBRunLoopModeInvalid = 0, eRNBRunLoopModeGetStartModeFromRemoteProtocol, eRNBRunLoopModeInferiorAttaching, @@ -54,7 +54,7 @@ typedef enum { eRNBRunLoopModeInferiorExecuting, eRNBRunLoopModePlatformMode, eRNBRunLoopModeExit -} RNBRunLoopMode; +}; // Global Variables RNBRemoteSP g_remoteSP; diff --git a/lldb/tools/debugserver/source/libdebugserver.cpp b/lldb/tools/debugserver/source/libdebugserver.cpp index e545caf5ae8..0b40dd9049f 100644 --- a/lldb/tools/debugserver/source/libdebugserver.cpp +++ b/lldb/tools/debugserver/source/libdebugserver.cpp @@ -27,12 +27,12 @@ #include "SysSignal.h" // Run loop modes which determine which run loop function will be called -typedef enum { +enum RNBRunLoopMode { eRNBRunLoopModeInvalid = 0, eRNBRunLoopModeGetStartModeFromRemoteProtocol, eRNBRunLoopModeInferiorExecuting, eRNBRunLoopModeExit -} RNBRunLoopMode; +}; // Global Variables RNBRemoteSP g_remoteSP; diff --git a/lldb/tools/driver/Driver.h b/lldb/tools/driver/Driver.h index 6bd6ec9e157..f442458ae40 100644 --- a/lldb/tools/driver/Driver.h +++ b/lldb/tools/driver/Driver.h @@ -26,11 +26,11 @@ class Driver : public lldb::SBBroadcaster { public: - typedef enum CommandPlacement { + enum CommandPlacement { eCommandPlacementBeforeFile, eCommandPlacementAfterFile, eCommandPlacementAfterCrash, - } CommandPlacement; + }; Driver(); |