[Lldb-commits] [PATCH] D130580: Refactor string conversion for InstructionControlFlowKind enum

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 26 11:51:57 PDT 2022


wallace accepted this revision.
wallace added a comment.

just remove that comment. I've just pushed Sujin's diff as well, so you can rebase



================
Comment at: lldb/include/lldb/lldb-enumerations.h:975-976
 /// A single instruction can match one or more of these categories.
+/// The enum -> string conversion is in Disassembler.cpp, don't change
+/// this enum without updating that code as well.
 enum InstructionControlFlowKind {
----------------
you can safely remove this comment because the compiler will complain if a new enum value is added and the switch case in GetNameForInstructionControlFlowKind is not updated


================
Comment at: lldb/source/Core/Disassembler.cpp:930
+  }
+}
+
----------------
persona0220 wrote:
> jj10306 wrote:
> > Thoughts on adding a default case with a string that indicates that no string conversion was implemented for the provided variant?
> > This would potentially make it easier for someone to realize they didn't add a case here for a newly added variant of InstructionControlFlowKind. Otherwise undefined data would be returned if a new case isn't added for a new variant.
> > wdyt?
> I agree to add a default here! 
no defaults for enums, otherwise the compiler won't complain if a new enum value is added and a case is not added here


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130580/new/

https://reviews.llvm.org/D130580



More information about the lldb-commits mailing list