summaryrefslogtreecommitdiffstats
path: root/lldb/utils/TableGen
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-07-29 16:41:30 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-07-29 16:41:30 +0000
commita8ea595509f33834091fb9e3234a373f83d709a8 (patch)
tree083004a39520082ad3caba6186c23d41ffb4ee6a /lldb/utils/TableGen
parentcc0bc941d4ebd0275fe206d78f395822258e73bc (diff)
downloadbcm5719-llvm-a8ea595509f33834091fb9e3234a373f83d709a8.tar.gz
bcm5719-llvm-a8ea595509f33834091fb9e3234a373f83d709a8.zip
[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
Diffstat (limited to 'lldb/utils/TableGen')
-rw-r--r--lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp b/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
index a41c2098c1e..f707b8e8d7d 100644
--- a/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
+++ b/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
@@ -124,8 +124,11 @@ static void emityProperties(std::string PropertyName,
// user to define the macro for the options that are needed.
OS << "// Property definitions for " << PropertyName << "\n";
OS << "#ifdef " << NeededMacro << "\n";
+ OS << "static constexpr PropertyDefinition g_" << PropertyName
+ << "_properties[] = {\n";
for (Record *R : PropertyRecords)
emitProperty(R, OS);
+ OS << "};\n";
// We undefine the macro for the user like Clang's include files are doing it.
OS << "#undef " << NeededMacro << "\n";
OS << "#endif // " << PropertyName << " Property\n\n";
OpenPOWER on IntegriCloud