diff options
Diffstat (limited to 'lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp')
-rw-r--r-- | lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp b/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp index f49c05c9a585..f36deeebf906 100644 --- a/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp +++ b/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp @@ -57,6 +57,21 @@ static void emitProperty(Record *Property, raw_ostream &OS) { assert(!(hasDefaultUnsignedValue && hasDefaultEnumValue) && "Property cannot have both a unsigned and enum default value."); + // Guarantee that every boolean property has a boolean default value. + assert(!(Property->getValueAsString("Type") == "Boolean" && + !Property->getValue("HasDefaultBooleanValue")) && + "Boolean property must have a boolean default value."); + + // Guarantee that every string property has a string default value. + assert(!(Property->getValueAsString("Type") == "String" && + !hasDefaultStringValue) && + "String property must have a string default value."); + + // Guarantee that every enum property has an enum default value. + assert( + !(Property->getValueAsString("Type") == "Enum" && !hasDefaultEnumValue) && + "Enum property must have a enum default value."); + // Emit the default uint value. if (hasDefaultUnsignedValue) { OS << std::to_string(Property->getValueAsInt("DefaultUnsignedValue")); |