[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 23 20:14:28 PDT 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: teemperor, friss, xiaobai, labath, clayborg.
Herald added a subscriber: mgorny.
Herald added a reviewer: jdoerfert.
Herald added a project: LLDB.

Property definitions are currently defined in a `PropertyDefinition` array and have a corresponding enum to index in this array. Unfortunately this is quite error prone. Indeed, just today we found an incorrect merge where a discrepancy between the order of the enum values and their definition caused the test suite to fail spectacularly.

Tablegen can streamline the process of generating the property definition table while at the same time guaranteeing that the enums stay in sync. That's exactly what this patch does. It adds a new tablegen file for the properties, building on top of the infrastructure that Raphael added recently for the command options. It also introduces two new tablegen backends: one for the property definitions and one for their corresponding enums.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D65185

Files:
  lldb/CMakeLists.txt
  lldb/include/lldb/Core/CMakeLists.txt
  lldb/include/lldb/Core/Properties.td
  lldb/include/lldb/Core/PropertiesBase.td
  lldb/source/Core/CMakeLists.txt
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/ModuleList.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Target/CMakeLists.txt
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/Target.cpp
  lldb/source/Target/Thread.cpp
  lldb/utils/TableGen/CMakeLists.txt
  lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
  lldb/utils/TableGen/LLDBTableGen.cpp
  lldb/utils/TableGen/LLDBTableGenBackends.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65185.211403.patch
Type: text/x-patch
Size: 78003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190724/e40af9c8/attachment-0001.bin>


More information about the lldb-commits mailing list