LCOV - code coverage report
Current view: top level - build-llvm/tools/clang/include/clang/Parse - AttrSubMatchRulesParserStringSwitches.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 52 63 82.5 %
Date: 2017-09-14 15:23:50 Functions: 7 7 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1           3 : Optional<attr::SubjectMatchRule> defaultIsAttributeSubjectMatchSubRuleFor(StringRef, bool) {
       2           3 :   return None;
       3             : }
       4             : 
       5           7 : Optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_function(StringRef Name, bool IsUnless) {
       6           7 :   if (IsUnless)
       7           0 :     return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
       8           0 :     Default(None);
       9           7 :   return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      10          28 :   Case("is_member", attr::SubjectMatchRule_function_is_member).
      11          21 :   Default(None);
      12             : }
      13             : 
      14           3 : Optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_hasType(StringRef Name, bool IsUnless) {
      15           3 :   if (IsUnless)
      16           0 :     return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      17           0 :     Default(None);
      18           3 :   return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      19          12 :   Case("functionType", attr::SubjectMatchRule_hasType_functionType).
      20           9 :   Default(None);
      21             : }
      22             : 
      23          25 : Optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_record(StringRef Name, bool IsUnless) {
      24          25 :   if (IsUnless)
      25          25 :     return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      26         100 :     Case("is_union", attr::SubjectMatchRule_record_not_is_union).
      27          75 :     Default(None);
      28           0 :   return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      29           0 :   Default(None);
      30             : }
      31             : 
      32          53 : Optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_variable(StringRef Name, bool IsUnless) {
      33          53 :   if (IsUnless)
      34          18 :     return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      35          72 :     Case("is_parameter", attr::SubjectMatchRule_variable_not_is_parameter).
      36          54 :     Default(None);
      37          35 :   return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      38         140 :   Case("is_thread_local", attr::SubjectMatchRule_variable_is_thread_local).
      39         140 :   Case("is_global", attr::SubjectMatchRule_variable_is_global).
      40         140 :   Case("is_parameter", attr::SubjectMatchRule_variable_is_parameter).
      41         105 :   Default(None);
      42             : }
      43             : 
      44           1 : Optional<attr::SubjectMatchRule> isAttributeSubjectMatchSubRuleFor_objc_method(StringRef Name, bool IsUnless) {
      45           1 :   if (IsUnless)
      46           0 :     return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      47           0 :     Default(None);
      48           1 :   return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
      49           4 :   Case("is_instance", attr::SubjectMatchRule_objc_method_is_instance).
      50           3 :   Default(None);
      51             : }
      52             : 
      53         312 : std::pair<Optional<attr::SubjectMatchRule>, Optional<attr::SubjectMatchRule> (*)(StringRef, bool)> isAttributeSubjectMatchRule(StringRef Name) {
      54         312 :   return llvm::StringSwitch<std::pair<Optional<attr::SubjectMatchRule>, Optional<attr::SubjectMatchRule> (*) (StringRef, bool)>>(Name).
      55        1248 :   Case("block", std::make_pair(attr::SubjectMatchRule_block, defaultIsAttributeSubjectMatchSubRuleFor)).
      56        1248 :   Case("enum", std::make_pair(attr::SubjectMatchRule_enum, defaultIsAttributeSubjectMatchSubRuleFor)).
      57        1248 :   Case("enum_constant", std::make_pair(attr::SubjectMatchRule_enum_constant, defaultIsAttributeSubjectMatchSubRuleFor)).
      58        1248 :   Case("field", std::make_pair(attr::SubjectMatchRule_field, defaultIsAttributeSubjectMatchSubRuleFor)).
      59        1248 :   Case("function", std::make_pair(attr::SubjectMatchRule_function, isAttributeSubjectMatchSubRuleFor_function)).
      60        1248 :   Case("namespace", std::make_pair(attr::SubjectMatchRule_namespace, defaultIsAttributeSubjectMatchSubRuleFor)).
      61        1248 :   Case("objc_category", std::make_pair(attr::SubjectMatchRule_objc_category, defaultIsAttributeSubjectMatchSubRuleFor)).
      62        1248 :   Case("objc_interface", std::make_pair(attr::SubjectMatchRule_objc_interface, defaultIsAttributeSubjectMatchSubRuleFor)).
      63        1248 :   Case("objc_method", std::make_pair(attr::SubjectMatchRule_objc_method, isAttributeSubjectMatchSubRuleFor_objc_method)).
      64        1248 :   Case("objc_property", std::make_pair(attr::SubjectMatchRule_objc_property, defaultIsAttributeSubjectMatchSubRuleFor)).
      65        1248 :   Case("objc_protocol", std::make_pair(attr::SubjectMatchRule_objc_protocol, defaultIsAttributeSubjectMatchSubRuleFor)).
      66        1248 :   Case("record", std::make_pair(attr::SubjectMatchRule_record, isAttributeSubjectMatchSubRuleFor_record)).
      67        1248 :   Case("hasType", std::make_pair(attr::SubjectMatchRule_hasType_abstract, isAttributeSubjectMatchSubRuleFor_hasType)).
      68        1248 :   Case("type_alias", std::make_pair(attr::SubjectMatchRule_type_alias, defaultIsAttributeSubjectMatchSubRuleFor)).
      69        1248 :   Case("variable", std::make_pair(attr::SubjectMatchRule_variable, isAttributeSubjectMatchSubRuleFor_variable)).
      70        1560 :   Default(std::make_pair(None, defaultIsAttributeSubjectMatchSubRuleFor));
      71             : }
      72             : 
      73             : const char *validAttributeSubjectMatchSubRules(attr::SubjectMatchRule Rule) {
      74          12 :   switch (Rule) {
      75             :   case attr::SubjectMatchRule_function:
      76             :   return "'is_member'";
      77           0 :   case attr::SubjectMatchRule_hasType_abstract:
      78             :   return "'functionType'";
      79           0 :   case attr::SubjectMatchRule_record:
      80             :   return "'unless(is_union)'";
      81           7 :   case attr::SubjectMatchRule_variable:
      82             :   return "'is_thread_local', 'is_global', 'is_parameter', 'unless(is_parameter)'";
      83           0 :   case attr::SubjectMatchRule_objc_method:
      84             :   return "'is_instance'";
      85             :   default: return nullptr;
      86             :   }
      87             : }
      88             : 

Generated by: LCOV version 1.13