[lldb] Also include the array definition in Properties.inc

Right now our Properties.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 Properties.inc generate it alongside the initializers.

Unfortunately we cannot do the same for enums, as there's this magic
ePropertyExperimental, which needs to come at the end to be interpreted
correctly. Hopefully we can get rid of this in the future and do the
same for the property enums.

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

llvm-svn: 367238
This commit is contained in:
Jonas Devlieghere
2019-07-29 16:41:30 +00:00
parent cc0bc941d4
commit a8ea595509
16 changed files with 105 additions and 129 deletions

View File

@@ -65,10 +65,8 @@ using namespace lldb_private;
namespace {
static constexpr PropertyDefinition g_properties[] = {
#define LLDB_PROPERTIES_modulelist
#include "Properties.inc"
};
enum {
#define LLDB_PROPERTIES_modulelist
@@ -80,7 +78,7 @@ enum {
ModuleListProperties::ModuleListProperties() {
m_collection_sp =
std::make_shared<OptionValueProperties>(ConstString("symbols"));
m_collection_sp->Initialize(g_properties);
m_collection_sp->Initialize(g_modulelist_properties);
llvm::SmallString<128> path;
clang::driver::Driver::getDefaultModuleCachePath(path);
@@ -90,7 +88,7 @@ ModuleListProperties::ModuleListProperties() {
bool ModuleListProperties::GetEnableExternalLookup() const {
const uint32_t idx = ePropertyEnableExternalLookup;
return m_collection_sp->GetPropertyAtIndexAsBoolean(
nullptr, idx, g_properties[idx].default_uint_value != 0);
nullptr, idx, g_modulelist_properties[idx].default_uint_value != 0);
}
bool ModuleListProperties::SetEnableExternalLookup(bool new_value) {