Let tablegen generate property definitions
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 25 Jul 2019 21:36:37 +0000 (21:36 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 25 Jul 2019 21:36:37 +0000 (21:36 +0000)
commit971f9ca612f22d251631f6b7dcc5efd8324bc0f2
tree282cdef9ce40fa67215fe675dc77e76b234f467c
parentd16a034c7cd33208a86301f05eb4c1a358914475
Let tablegen generate property definitions

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.

It might be worth mentioning that I generated most of the tablegen
definitions from the existing property definitions, by adding a dump
method to the struct. This seems both more efficient and less error
prone that copying everything over by hand. Only Enum properties needed
manual fixup for the EnumValues and DefaultEnumValue fields.

Differential revision: https://reviews.llvm.org/D65185

llvm-svn: 367058
38 files changed:
lldb/CMakeLists.txt
lldb/include/lldb/Core/CMakeLists.txt [new file with mode: 0644]
lldb/include/lldb/Core/Properties.td [new file with mode: 0644]
lldb/include/lldb/Core/PropertiesBase.td [new file with mode: 0644]
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/CMakeLists.txt
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td [new file with mode: 0644]
lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
lldb/source/Plugins/JITLoader/GDB/Properties.td [new file with mode: 0644]
lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/source/Plugins/Platform/MacOSX/Properties.td [new file with mode: 0644]
lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td [new file with mode: 0644]
lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/Properties.td [new file with mode: 0644]
lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
lldb/source/Plugins/StructuredData/DarwinLog/Properties.td [new file with mode: 0644]
lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
lldb/source/Plugins/SymbolFile/DWARF/Properties.td [new file with mode: 0644]
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 [new file with mode: 0644]
lldb/utils/TableGen/LLDBTableGen.cpp
lldb/utils/TableGen/LLDBTableGenBackends.h