Coverage Report

Created: 2018-12-14 11:24

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/tools/clang/include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc
Line
Count
Source (jump to first uncovered line)
1
3
Optional<attr::SubjectMatchRule> defaultIsAttributeSubjectMatchSubRuleFor(StringRef, bool) {
2
3
  return None;
3
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
7
  Case("is_member", attr::SubjectMatchRule_function_is_member).
11
7
  Default(None);
12
7
}
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
3
  Case("functionType", attr::SubjectMatchRule_hasType_functionType).
20
3
  Default(None);
21
3
}
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
25
    Case("is_union", attr::SubjectMatchRule_record_not_is_union).
27
25
    Default(None);
28
0
  return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
29
0
  Default(None);
30
0
}
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
18
    Case("is_parameter", attr::SubjectMatchRule_variable_not_is_parameter).
36
18
    Default(None);
37
35
  return llvm::StringSwitch<Optional<attr::SubjectMatchRule>>(Name).
38
35
  Case("is_thread_local", attr::SubjectMatchRule_variable_is_thread_local).
39
35
  Case("is_global", attr::SubjectMatchRule_variable_is_global).
40
35
  Case("is_parameter", attr::SubjectMatchRule_variable_is_parameter).
41
35
  Default(None);
42
35
}
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
1
  Case("is_instance", attr::SubjectMatchRule_objc_method_is_instance).
50
1
  Default(None);
51
1
}
52
53
318
std::pair<Optional<attr::SubjectMatchRule>, Optional<attr::SubjectMatchRule> (*)(StringRef, bool)> isAttributeSubjectMatchRule(StringRef Name) {
54
318
  return llvm::StringSwitch<std::pair<Optional<attr::SubjectMatchRule>, Optional<attr::SubjectMatchRule> (*) (StringRef, bool)>>(Name).
55
318
  Case("block", std::make_pair(attr::SubjectMatchRule_block, defaultIsAttributeSubjectMatchSubRuleFor)).
56
318
  Case("enum", std::make_pair(attr::SubjectMatchRule_enum, defaultIsAttributeSubjectMatchSubRuleFor)).
57
318
  Case("enum_constant", std::make_pair(attr::SubjectMatchRule_enum_constant, defaultIsAttributeSubjectMatchSubRuleFor)).
58
318
  Case("field", std::make_pair(attr::SubjectMatchRule_field, defaultIsAttributeSubjectMatchSubRuleFor)).
59
318
  Case("function", std::make_pair(attr::SubjectMatchRule_function, isAttributeSubjectMatchSubRuleFor_function)).
60
318
  Case("namespace", std::make_pair(attr::SubjectMatchRule_namespace, defaultIsAttributeSubjectMatchSubRuleFor)).
61
318
  Case("objc_category", std::make_pair(attr::SubjectMatchRule_objc_category, defaultIsAttributeSubjectMatchSubRuleFor)).
62
318
  Case("objc_interface", std::make_pair(attr::SubjectMatchRule_objc_interface, defaultIsAttributeSubjectMatchSubRuleFor)).
63
318
  Case("objc_method", std::make_pair(attr::SubjectMatchRule_objc_method, isAttributeSubjectMatchSubRuleFor_objc_method)).
64
318
  Case("objc_property", std::make_pair(attr::SubjectMatchRule_objc_property, defaultIsAttributeSubjectMatchSubRuleFor)).
65
318
  Case("objc_protocol", std::make_pair(attr::SubjectMatchRule_objc_protocol, defaultIsAttributeSubjectMatchSubRuleFor)).
66
318
  Case("record", std::make_pair(attr::SubjectMatchRule_record, isAttributeSubjectMatchSubRuleFor_record)).
67
318
  Case("hasType", std::make_pair(attr::SubjectMatchRule_hasType_abstract, isAttributeSubjectMatchSubRuleFor_hasType)).
68
318
  Case("type_alias", std::make_pair(attr::SubjectMatchRule_type_alias, defaultIsAttributeSubjectMatchSubRuleFor)).
69
318
  Case("variable", std::make_pair(attr::SubjectMatchRule_variable, isAttributeSubjectMatchSubRuleFor_variable)).
70
318
  Default(std::make_pair(None, defaultIsAttributeSubjectMatchSubRuleFor));
71
318
}
72
73
12
const char *validAttributeSubjectMatchSubRules(attr::SubjectMatchRule Rule) {
74
12
  switch (Rule) {
75
12
  case attr::SubjectMatchRule_function:
76
0
  return "'is_member'";
77
12
  case attr::SubjectMatchRule_hasType_abstract:
78
0
  return "'functionType'";
79
12
  case attr::SubjectMatchRule_record:
80
0
  return "'unless(is_union)'";
81
12
  case attr::SubjectMatchRule_variable:
82
7
  return "'is_thread_local', 'is_global', 'is_parameter', 'unless(is_parameter)'";
83
12
  case attr::SubjectMatchRule_objc_method:
84
0
  return "'is_instance'";
85
12
  
default: return nullptr5
;
86
12
  }
87
12
}
88