summaryrefslogtreecommitdiff
path: root/lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
AgeCommit message (Collapse)Author
2025-05-17[lldb] Use llvm::replace (NFC) (#140343)Kazu Hirata
2024-09-09[LLDB][TableGen] Migrate lldb-tblgen to use const RecordKeeper (#107536)Rahul Joshi
Migrate LLDB TableGen backend to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2023-09-26[llvm][tblgen] Add `Source Filename` for `emitSourceFileHeader` (#65744)Shao-Ce SUN
I think this is very helpful for reading generated `.inc` files.
2023-06-06[lldb/Commands] Add support to auto-completion for user commandsMed Ismail Bennani
This patch should allow the user to set specific auto-completion type for their custom commands. To do so, we had to hoist the `CompletionType` enum so the user can access it and add a new completion type flag to the CommandScriptAdd Command Object. So now, the user can specify which completion type will be used with their custom command, when they register it. This also makes the `crashlog` custom commands use disk-file completion type, to browse through the user file system and load the report. Differential Revision: https://reviews.llvm.org/D152011 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2022-07-14[lldb] Refactor command option enum values (NFC)Jonas Devlieghere
Refactor the command option enum values and the command argument table to connect the two. This has two benefits: - We guarantee that two options that use the same argument type have the same accepted values. - We can print the enum values and their description in the help output. (D129707) Differential revision: https://reviews.llvm.org/D129703
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2019-07-31[TableGen] Move helpers into LLDBTableGenUtils.Jonas Devlieghere
Instead of polluting the LLDBTableGenBackends header with helpers used by both emitters, move them into a separate files. llvm-svn: 367377
2019-07-30[TableGen] Reuse typedef across emitters (NFC)Jonas Devlieghere
This moves the std::map typedef into the header so it can be reused by all the emitter implementations. llvm-svn: 367363
2019-07-29[lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitterRaphael Isemann
Splitting the different logic is cleaner and we it will be easier to implement the enum emitting (which otherwise would have to reimplement the Record parsing). llvm-svn: 367207
2019-07-28[lldb] Also include the array definition in CommandOptions.incRaphael Isemann
Summary: Right now our CommandOptions.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the CommandOptions.inc generate it alongside the initializers. This patch will also allow us to generate additional declarations related to that option list in the future (e.g. a enum class representing the specific options which would make our handling code less prone). This patch also fixes a few option tables that didn't follow our naming style. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65331 llvm-svn: 367186
2019-07-26[lldb] Don't dynamically allocate the posix option validator.Raphael Isemann
We dynamically allocate the option validator which means we can't mark this list of OptionDefinitions as constexpr. It's also more complicated than necessary. llvm-svn: 367102
2019-07-25[TableGen] Fix comments/headers referencing clang (NFC)Jonas Devlieghere
Remove references to clang's TableGen implementation. Presumably these files were originally copied over. llvm-svn: 366982
2019-07-23[Utils] Add back utils directoryJonas Devlieghere
Due to a bug my earlier commit removed the whole utils directory: https://reviews.llvm.org/D65123 llvm-svn: 366830
2019-07-23[Utils] Remove legacy scriptsJonas Devlieghere
As pointed out by Nathan in D65155, these scrips don't seem to serve any real need anymore. llvm-svn: 366827
2019-07-22[lldb][NFC] Tablegenify breakpointRaphael Isemann
llvm-svn: 366673
2019-07-18[lldb] Don't double emit option groupsRaphael Isemann
We currently emit the option groups twice if Groups<[1,2,3]> is used in the tablegen. This leads to compilation errors. This patch just removes the line that accidentially emits the option group a second time. llvm-svn: 366414
2019-07-12[lldb] Let table gen create command option initializers.Raphael Isemann
Summary: We currently have man large arrays containing initializers for our command options. These tables are tricky maintain as we don't have any good place to check them for consistency and it's also hard to read (`nullptr, {}, 0` is not very descriptive). This patch fixes this by letting table gen generate those tables. This way we can have a more readable syntax for this (especially for all the default arguments) and we can let TableCheck check them for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.). Also refactoring the related data structures can now be done without changing the hundred of option initializers. For example, this line: ``` {LLDB_OPT_SET_ALL, false, "hide-aliases", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."}, ``` becomes this: ``` def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">; ``` For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other option initializers tables in separate patches. Reviewers: JDevlieghere, davide, sgraenitz Reviewed By: JDevlieghere Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D64365 llvm-svn: 365908