[Lldb-commits] [PATCH] D65386: [lldb][NFC] Use an enum instead of chars when handling options [WIP]
    Pavel Labath via Phabricator via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Mon Jul 29 07:58:11 PDT 2019
    
    
  
labath added a comment.
How about codegenning the entire implementation of `SetOptionValue`? That way the user won't have to write any switch statements at all. Ideally, the option-setting code would be something like:
  void (Status?, Error?) SetOptionForce(StringRef arg, ExecutionContext *ctx) { m_force = true; }
  void (Status?, Error?) SetOptionGlobal(StringRef arg, ExecutionContext *ctx) { m_global = true; }
  
  #include "The_thing_which_generates_SetOptionValue.inc"
The generated implementation of SetOptionValue could be the same as the current one, except that it calls into these user-specified functions instead of setting the values itself
Repository:
  rLLDB LLDB
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65386/new/
https://reviews.llvm.org/D65386
    
    
More information about the lldb-commits
mailing list