Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Basic/Attributes.cpp
Line
Count
Source (jump to first uncovered line)
1
#include "clang/Basic/Attributes.h"
2
#include "clang/Basic/AttrSubjectMatchRules.h"
3
#include "clang/Basic/IdentifierTable.h"
4
#include "llvm/ADT/StringSwitch.h"
5
using namespace clang;
6
7
int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
8
                        const IdentifierInfo *Attr, const TargetInfo &Target,
9
52.0k
                        const LangOptions &LangOpts) {
10
52.0k
  StringRef Name = Attr->getName();
11
52.0k
  // Normalize the attribute name, __foo__ becomes foo.
12
52.0k
  if (Name.size() >= 4 && 
Name.startswith("__")52.0k
&&
Name.endswith("__")7.24k
)
13
7.23k
    Name = Name.substr(2, Name.size() - 4);
14
52.0k
15
52.0k
  // Normalize the scope name, but only for gnu and clang attributes.
16
52.0k
  StringRef ScopeName = Scope ? 
Scope->getName()1.18k
:
""50.8k
;
17
52.0k
  if (ScopeName == "__gnu__")
18
3
    ScopeName = "gnu";
19
52.0k
  else if (ScopeName == "_Clang")
20
8
    ScopeName = "clang";
21
52.0k
22
52.0k
#include "clang/Basic/AttrHasAttributeImpl.inc"
23
52.0k
24
52.0k
  
return 011
;
25
52.0k
}
26
27
131
const char *attr::getSubjectMatchRuleSpelling(attr::SubjectMatchRule Rule) {
28
131
  switch (Rule) {
29
131
#define ATTR_MATCH_RULE(NAME, SPELLING, IsAbstract)                            \
30
131
  case attr::NAME:                                                             \
31
131
    return SPELLING;
32
131
#include 
"clang/Basic/AttrSubMatchRulesList.inc"0
33
131
  }
34
131
  
llvm_unreachable0
("Invalid subject match rule");
35
}