Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/AST/CommentVisitor.h
Line
Count
Source (jump to first uncovered line)
1
//===- CommentVisitor.h - Visitor for Comment subclasses --------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_AST_COMMENTVISITOR_H
10
#define LLVM_CLANG_AST_COMMENTVISITOR_H
11
12
#include "clang/AST/Comment.h"
13
#include "llvm/ADT/STLExtras.h"
14
#include "llvm/Support/ErrorHandling.h"
15
16
namespace clang {
17
namespace comments {
18
template <template <typename> class Ptr, typename ImplClass,
19
          typename RetTy = void, class... ParamTys>
20
class CommentVisitorBase {
21
public:
22
#define PTR(CLASS) typename Ptr<CLASS>::type
23
#define DISPATCH(NAME, CLASS)                                                  \
24
1.71k
  return static_cast<ImplClass *>(this)->visit##NAME(                          \
25
1.71k
      static_cast<PTR(CLASS)>(C), std::forward<ParamTys>(P)...)
26
27
1.15k
  RetTy visit(PTR(Comment) C, ParamTys... P) {
28
1.15k
    if (!C)
29
0
      return RetTy();
30
1.15k
31
1.15k
    switch (C->getCommentKind()) {
32
1.15k
    
default: 0
llvm_unreachable0
("Unknown comment kind!");
33
1.15k
#define ABSTRACT_COMMENT(COMMENT)
34
1.15k
#define COMMENT(CLASS, PARENT) \
35
1.15k
    case Comment::CLASS##Kind: 
DISPATCH798
(CLASS, CLASS);
36
1.15k
#include 
"clang/AST/CommentNodes.inc"22
37
1.15k
#undef ABSTRACT_COMMENT
38
1.15k
#undef COMMENT
39
1.15k
    }
40
1.15k
  }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visit(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
27
64
  RetTy visit(PTR(Comment) C, ParamTys... P) {
28
64
    if (!C)
29
0
      return RetTy();
30
64
31
64
    switch (C->getCommentKind()) {
32
64
    
default: 0
llvm_unreachable0
("Unknown comment kind!");
33
64
#define ABSTRACT_COMMENT(COMMENT)
34
64
#define COMMENT(CLASS, PARENT) \
35
64
    case Comment::CLASS##Kind: DISPATCH(CLASS, CLASS);
36
64
#include 
"clang/AST/CommentNodes.inc"1
37
64
#undef ABSTRACT_COMMENT
38
64
#undef COMMENT
39
64
    }
40
64
  }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visit(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
27
513
  RetTy visit(PTR(Comment) C, ParamTys... P) {
28
513
    if (!C)
29
0
      return RetTy();
30
513
31
513
    switch (C->getCommentKind()) {
32
513
    
default: 0
llvm_unreachable0
("Unknown comment kind!");
33
513
#define ABSTRACT_COMMENT(COMMENT)
34
513
#define COMMENT(CLASS, PARENT) \
35
513
    case Comment::CLASS##Kind: DISPATCH(CLASS, CLASS);
36
513
#include 
"clang/AST/CommentNodes.inc"10
37
513
#undef ABSTRACT_COMMENT
38
513
#undef COMMENT
39
513
    }
40
513
  }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONNodeDumper, void, clang::comments::FullComment const*>::visit(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
27
64
  RetTy visit(PTR(Comment) C, ParamTys... P) {
28
64
    if (!C)
29
0
      return RetTy();
30
64
31
64
    switch (C->getCommentKind()) {
32
64
    
default: 0
llvm_unreachable0
("Unknown comment kind!");
33
64
#define ABSTRACT_COMMENT(COMMENT)
34
64
#define COMMENT(CLASS, PARENT) \
35
64
    case Comment::CLASS##Kind: DISPATCH(CLASS, CLASS);
36
64
#include 
"clang/AST/CommentNodes.inc"1
37
64
#undef ABSTRACT_COMMENT
38
64
#undef COMMENT
39
64
    }
40
64
  }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::TextNodeDumper, void, clang::comments::FullComment const*>::visit(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
27
513
  RetTy visit(PTR(Comment) C, ParamTys... P) {
28
513
    if (!C)
29
0
      return RetTy();
30
513
31
513
    switch (C->getCommentKind()) {
32
513
    
default: 0
llvm_unreachable0
("Unknown comment kind!");
33
513
#define ABSTRACT_COMMENT(COMMENT)
34
513
#define COMMENT(CLASS, PARENT) \
35
513
    case Comment::CLASS##Kind: DISPATCH(CLASS, CLASS);
36
513
#include 
"clang/AST/CommentNodes.inc"10
37
513
#undef ABSTRACT_COMMENT
38
513
#undef COMMENT
39
513
    }
40
513
  }
41
42
  // If the derived class does not implement a certain Visit* method, fall back
43
  // on Visit* method for the superclass.
44
632
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitBlockContentComment(clang::comments::BlockContentComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
26
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitHTMLTagComment(clang::comments::HTMLTagComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
3
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitInlineContentComment(clang::comments::InlineContentComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
25
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitBlockContentComment(clang::comments::BlockContentComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
207
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitHTMLTagComment(clang::comments::HTMLTagComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
22
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitInlineContentComment(clang::comments::InlineContentComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
185
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONNodeDumper, void, clang::comments::FullComment const*>::visitBlockContentComment(clang::comments::BlockContentComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
18
#define ABSTRACT_COMMENT(COMMENT) COMMENT
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::TextNodeDumper, void, clang::comments::FullComment const*>::visitBlockContentComment(clang::comments::BlockContentComment const*, clang::comments::FullComment const*)
Line
Count
Source
44
146
#define ABSTRACT_COMMENT(COMMENT) COMMENT
45
#define COMMENT(CLASS, PARENT)                                                 \
46
915
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitBlockCommandComment(clang::comments::BlockCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
8
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitParamCommandComment(clang::comments::ParamCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
4
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitTParamCommandComment(clang::comments::TParamCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
2
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitVerbatimBlockComment(clang::comments::VerbatimBlockComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
1
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
Unexecuted instantiation: clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitVerbatimLineComment(clang::comments::VerbatimLineComment const*, clang::comments::FullComment const*)
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitParagraphComment(clang::comments::ParagraphComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
18
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitFullComment(clang::comments::FullComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
12
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitHTMLEndTagComment(clang::comments::HTMLEndTagComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
1
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitHTMLStartTagComment(clang::comments::HTMLStartTagComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
2
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitInlineCommandComment(clang::comments::InlineCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
1
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitTextComment(clang::comments::TextComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
21
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitVerbatimBlockLineComment(clang::comments::VerbatimBlockLineComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
1
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitBlockCommandComment(clang::comments::BlockCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
61
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitParamCommandComment(clang::comments::ParamCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
27
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitTParamCommandComment(clang::comments::TParamCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
7
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitVerbatimBlockComment(clang::comments::VerbatimBlockComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
13
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitVerbatimLineComment(clang::comments::VerbatimLineComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
4
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitParagraphComment(clang::comments::ParagraphComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
146
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitFullComment(clang::comments::FullComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
104
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitHTMLEndTagComment(clang::comments::HTMLEndTagComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
6
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitHTMLStartTagComment(clang::comments::HTMLStartTagComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
16
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitInlineCommandComment(clang::comments::InlineCommandComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
6
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitTextComment(clang::comments::TextComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
157
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitVerbatimBlockLineComment(clang::comments::VerbatimBlockLineComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
17
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONNodeDumper, void, clang::comments::FullComment const*>::visitParagraphComment(clang::comments::ParagraphComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
18
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONNodeDumper, void, clang::comments::FullComment const*>::visitFullComment(clang::comments::FullComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
12
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::TextNodeDumper, void, clang::comments::FullComment const*>::visitParagraphComment(clang::comments::ParagraphComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
146
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::TextNodeDumper, void, clang::comments::FullComment const*>::visitFullComment(clang::comments::FullComment const*, clang::comments::FullComment const*)
Line
Count
Source
46
104
  RetTy visit##CLASS(PTR(CLASS) C, ParamTys... P) { DISPATCH(PARENT, PARENT); }
47
#include "clang/AST/CommentNodes.inc"
48
#undef ABSTRACT_COMMENT
49
#undef COMMENT
50
51
857
  RetTy visitComment(PTR(Comment) C, ParamTys... P) { return RetTy(); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONDumper, void, clang::comments::FullComment const*>::visitComment(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
51
64
  RetTy visitComment(PTR(Comment) C, ParamTys... P) { return RetTy(); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::ASTDumper, void, clang::comments::FullComment const*>::visitComment(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
51
513
  RetTy visitComment(PTR(Comment) C, ParamTys... P) { return RetTy(); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::JSONNodeDumper, void, clang::comments::FullComment const*>::visitComment(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
51
30
  RetTy visitComment(PTR(Comment) C, ParamTys... P) { return RetTy(); }
clang::comments::CommentVisitorBase<llvm::make_const_ptr, clang::TextNodeDumper, void, clang::comments::FullComment const*>::visitComment(clang::comments::Comment const*, clang::comments::FullComment const*)
Line
Count
Source
51
250
  RetTy visitComment(PTR(Comment) C, ParamTys... P) { return RetTy(); }
52
53
#undef PTR
54
#undef DISPATCH
55
};
56
57
template <typename ImplClass, typename RetTy = void, class... ParamTys>
58
class CommentVisitor : public CommentVisitorBase<std::add_pointer, ImplClass,
59
                                                 RetTy, ParamTys...> {};
60
61
template <typename ImplClass, typename RetTy = void, class... ParamTys>
62
class ConstCommentVisitor
63
    : public CommentVisitorBase<llvm::make_const_ptr, ImplClass, RetTy,
64
                                ParamTys...> {};
65
66
} // namespace comments
67
} // namespace clang
68
69
#endif // LLVM_CLANG_AST_COMMENTVISITOR_H