Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc is written in an unsupported language. File is not indexed.

0001 std::optional<attr::SubjectMatchRule> defaultIsAttributeSubjectMatchSubRuleFor(StringRef, bool) {
0002   return std::nullopt;
0003 }
0004 
0005 std::optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_function(StringRef Name, bool IsUnless) {
0006   if (IsUnless)
0007     return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0008     Default(std::nullopt);
0009   return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0010   Case("is_member", attr::SubjectMatchRule_function_is_member).
0011   Default(std::nullopt);
0012 }
0013 
0014 std::optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_objc_method(StringRef Name, bool IsUnless) {
0015   if (IsUnless)
0016     return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0017     Default(std::nullopt);
0018   return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0019   Case("is_instance", attr::SubjectMatchRule_objc_method_is_instance).
0020   Default(std::nullopt);
0021 }
0022 
0023 std::optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_record(StringRef Name, bool IsUnless) {
0024   if (IsUnless)
0025     return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0026     Case("is_union", attr::SubjectMatchRule_record_not_is_union).
0027     Default(std::nullopt);
0028   return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0029   Default(std::nullopt);
0030 }
0031 
0032 std::optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_hasType(StringRef Name, bool IsUnless) {
0033   if (IsUnless)
0034     return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0035     Default(std::nullopt);
0036   return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0037   Case("functionType", attr::SubjectMatchRule_hasType_functionType).
0038   Default(std::nullopt);
0039 }
0040 
0041 std::optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_variable(StringRef Name, bool IsUnless) {
0042   if (IsUnless)
0043     return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0044     Case("is_parameter", attr::SubjectMatchRule_variable_not_is_parameter).
0045     Default(std::nullopt);
0046   return llvm::StringSwitch<std::optional<attr::SubjectMatchRule>>(Name).
0047   Case("is_thread_local", attr::SubjectMatchRule_variable_is_thread_local).
0048   Case("is_global", attr::SubjectMatchRule_variable_is_global).
0049   Case("is_local", attr::SubjectMatchRule_variable_is_local).
0050   Case("is_parameter", attr::SubjectMatchRule_variable_is_parameter).
0051   Default(std::nullopt);
0052 }
0053 
0054 std::pair<std::optional<attr::SubjectMatchRule>, std::optional<attr::SubjectMatchRule> (*)(StringRef, bool)> isAttributeSubjectMatchRule(StringRef Name) {
0055   return llvm::StringSwitch<std::pair<std::optional<attr::SubjectMatchRule>, std::optional<attr::SubjectMatchRule> (*) (StringRef, bool)>>(Name).
0056   Case("block", std::make_pair(attr::SubjectMatchRule_block, defaultIsAttributeSubjectMatchSubRuleFor)).
0057   Case("enum", std::make_pair(attr::SubjectMatchRule_enum, defaultIsAttributeSubjectMatchSubRuleFor)).
0058   Case("enum_constant", std::make_pair(attr::SubjectMatchRule_enum_constant, defaultIsAttributeSubjectMatchSubRuleFor)).
0059   Case("field", std::make_pair(attr::SubjectMatchRule_field, defaultIsAttributeSubjectMatchSubRuleFor)).
0060   Case("function", std::make_pair(attr::SubjectMatchRule_function, isAttributeSubjectMatchSubRuleFor_function)).
0061   Case("namespace", std::make_pair(attr::SubjectMatchRule_namespace, defaultIsAttributeSubjectMatchSubRuleFor)).
0062   Case("objc_category", std::make_pair(attr::SubjectMatchRule_objc_category, defaultIsAttributeSubjectMatchSubRuleFor)).
0063   Case("objc_implementation", std::make_pair(attr::SubjectMatchRule_objc_implementation, defaultIsAttributeSubjectMatchSubRuleFor)).
0064   Case("objc_interface", std::make_pair(attr::SubjectMatchRule_objc_interface, defaultIsAttributeSubjectMatchSubRuleFor)).
0065   Case("objc_method", std::make_pair(attr::SubjectMatchRule_objc_method, isAttributeSubjectMatchSubRuleFor_objc_method)).
0066   Case("objc_property", std::make_pair(attr::SubjectMatchRule_objc_property, defaultIsAttributeSubjectMatchSubRuleFor)).
0067   Case("objc_protocol", std::make_pair(attr::SubjectMatchRule_objc_protocol, defaultIsAttributeSubjectMatchSubRuleFor)).
0068   Case("record", std::make_pair(attr::SubjectMatchRule_record, isAttributeSubjectMatchSubRuleFor_record)).
0069   Case("hasType", std::make_pair(attr::SubjectMatchRule_hasType_abstract, isAttributeSubjectMatchSubRuleFor_hasType)).
0070   Case("type_alias", std::make_pair(attr::SubjectMatchRule_type_alias, defaultIsAttributeSubjectMatchSubRuleFor)).
0071   Case("variable", std::make_pair(attr::SubjectMatchRule_variable, isAttributeSubjectMatchSubRuleFor_variable)).
0072   Default(std::make_pair(std::nullopt, defaultIsAttributeSubjectMatchSubRuleFor));
0073 }
0074 
0075 const char *validAttributeSubjectMatchSubRules(attr::SubjectMatchRule Rule) {
0076   switch (Rule) {
0077   case attr::SubjectMatchRule_function:
0078   return "'is_member'";
0079   case attr::SubjectMatchRule_objc_method:
0080   return "'is_instance'";
0081   case attr::SubjectMatchRule_record:
0082   return "'unless(is_union)'";
0083   case attr::SubjectMatchRule_hasType_abstract:
0084   return "'functionType'";
0085   case attr::SubjectMatchRule_variable:
0086   return "'is_thread_local', 'is_global', 'is_local', 'is_parameter', 'unless(is_parameter)'";
0087   default: return nullptr;
0088   }
0089 }
0090