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

Generated by: LCOV version 1.13