Coverage Report

Created: 2019-02-21 13:17

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h
Line
Count
Source (jump to first uncovered line)
1
//===--- SValVisitor.h - Visitor for SVal 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
//  This file defines the SValVisitor, SymExprVisitor, and MemRegionVisitor
10
//  interfaces, and also FullSValVisitor, which visits all three hierarchies.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SVALVISITOR_H
15
#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SVALVISITOR_H
16
17
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
18
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
19
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
20
21
namespace clang {
22
23
namespace ento {
24
25
/// SValVisitor - this class implements a simple visitor for SVal
26
/// subclasses.
27
template <typename ImplClass, typename RetTy = void> class SValVisitor {
28
public:
29
30
#define DISPATCH(NAME, CLASS) \
31
773k
  return static_cast<ImplClass *>(this)->Visit ## NAME(V.castAs<CLASS>())
32
33
137k
  RetTy Visit(SVal V) {
34
137k
    // Dispatch to VisitFooVal for each FooVal.
35
137k
    // Take namespaces (loc:: and nonloc::) into account.
36
137k
    switch (V.getBaseKind()) {
37
274k
#define BASIC_SVAL(Id, Parent) 
case SVal::Id ## Kind: 8
DISPATCH(Id, Id);
38
137k
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
39
137k
    case SVal::LocKind:
40
25
      switch (V.getSubKind()) {
41
25
#define LOC_SVAL(Id, Parent) \
42
50
      
case loc::Id ## Kind: 25
DISPATCH(Loc ## Id, loc :: Id);
43
25
#include 
"clang/StaticAnalyzer/Core/PathSensitive/SVals.def"2
44
25
      }
45
25
      
llvm_unreachable0
("Unknown Loc sub-kind!");
46
137k
    case SVal::NonLocKind:
47
137k
      switch (V.getSubKind()) {
48
137k
#define NONLOC_SVAL(Id, Parent) \
49
209k
      
case nonloc::Id ## Kind: 137k
DISPATCH(NonLoc ## Id, nonloc :: Id);
50
137k
#include 
"clang/StaticAnalyzer/Core/PathSensitive/SVals.def"0
51
137k
      }
52
137k
      
llvm_unreachable0
("Unknown NonLoc sub-kind!");
53
137k
    }
54
137k
    
llvm_unreachable0
("Unknown SVal kind!");
55
137k
  }
clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Visit(clang::ento::SVal)
Line
Count
Source
33
46
  RetTy Visit(SVal V) {
34
46
    // Dispatch to VisitFooVal for each FooVal.
35
46
    // Take namespaces (loc:: and nonloc::) into account.
36
46
    switch (V.getBaseKind()) {
37
46
#define BASIC_SVAL(Id, Parent) case SVal::Id ## Kind: DISPATCH(Id, Id);
38
46
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
39
46
    case SVal::LocKind:
40
25
      switch (V.getSubKind()) {
41
25
#define LOC_SVAL(Id, Parent) \
42
25
      case loc::Id ## Kind: DISPATCH(Loc ## Id, loc :: Id);
43
25
#include 
"clang/StaticAnalyzer/Core/PathSensitive/SVals.def"2
44
25
      }
45
25
      
llvm_unreachable0
("Unknown Loc sub-kind!");
46
25
    case SVal::NonLocKind:
47
20
      switch (V.getSubKind()) {
48
20
#define NONLOC_SVAL(Id, Parent) \
49
20
      case nonloc::Id ## Kind: DISPATCH(NonLoc ## Id, nonloc :: Id);
50
20
#include 
"clang/StaticAnalyzer/Core/PathSensitive/SVals.def"0
51
20
      }
52
20
      
llvm_unreachable0
("Unknown NonLoc sub-kind!");
53
46
    }
54
46
    
llvm_unreachable0
("Unknown SVal kind!");
55
  }
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::Visit(clang::ento::SVal)
Line
Count
Source
33
137k
  RetTy Visit(SVal V) {
34
137k
    // Dispatch to VisitFooVal for each FooVal.
35
137k
    // Take namespaces (loc:: and nonloc::) into account.
36
137k
    switch (V.getBaseKind()) {
37
137k
#define BASIC_SVAL(Id, Parent) case SVal::Id ## Kind: DISPATCH(Id, Id);
38
137k
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
39
137k
    case SVal::LocKind:
40
0
      switch (V.getSubKind()) {
41
0
#define LOC_SVAL(Id, Parent) \
42
0
      case loc::Id ## Kind: DISPATCH(Loc ## Id, loc :: Id);
43
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
44
0
      }
45
0
      llvm_unreachable("Unknown Loc sub-kind!");
46
137k
    case SVal::NonLocKind:
47
137k
      switch (V.getSubKind()) {
48
137k
#define NONLOC_SVAL(Id, Parent) \
49
137k
      case nonloc::Id ## Kind: DISPATCH(NonLoc ## Id, nonloc :: Id);
50
137k
#include 
"clang/StaticAnalyzer/Core/PathSensitive/SVals.def"0
51
137k
      }
52
137k
      
llvm_unreachable0
("Unknown NonLoc sub-kind!");
53
137k
    }
54
137k
    
llvm_unreachable0
("Unknown SVal kind!");
55
  }
56
57
#define BASIC_SVAL(Id, Parent) \
58
216k
  RetTy Visit ## Id(Id V) { DISPATCH(Parent, Id); }
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitLoc(clang::ento::Loc)
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitDefinedSVal(clang::ento::DefinedSVal)
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitDefinedOrUnknownSVal(clang::ento::DefinedOrUnknownSVal)
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitNonLoc(clang::ento::NonLoc)
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitUndefinedVal(clang::ento::UndefinedVal)
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitUnknownVal(clang::ento::UnknownVal)
Line
Count
Source
58
7
  RetTy Visit ## Id(Id V) { DISPATCH(Parent, Id); }
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitDefinedOrUnknownSVal(clang::ento::DefinedOrUnknownSVal)
Line
Count
Source
58
72.1k
  RetTy Visit ## Id(Id V) { DISPATCH(Parent, Id); }
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitLoc(clang::ento::Loc)
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitDefinedSVal(clang::ento::DefinedSVal)
Line
Count
Source
58
72.0k
  RetTy Visit ## Id(Id V) { DISPATCH(Parent, Id); }
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitNonLoc(clang::ento::NonLoc)
Line
Count
Source
58
72.0k
  RetTy Visit ## Id(Id V) { DISPATCH(Parent, Id); }
59
#define ABSTRACT_SVAL(Id, Parent) \
60
  BASIC_SVAL(Id, Parent)
61
#define LOC_SVAL(Id, Parent) \
62
0
  RetTy VisitLoc ## Id(loc::Id V) { DISPATCH(Parent, Parent); }
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitLocGotoLabel(clang::ento::loc::GotoLabel)
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitLocConcreteInt(clang::ento::loc::ConcreteInt)
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitLocGotoLabel(clang::ento::loc::GotoLabel)
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitLocMemRegionVal(clang::ento::loc::MemRegionVal)
63
#define NONLOC_SVAL(Id, Parent) \
64
72.0k
  RetTy VisitNonLoc ## Id(nonloc::Id V) { DISPATCH(Parent, Parent); }
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitNonLocCompoundVal(clang::ento::nonloc::CompoundVal)
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitNonLocLocAsInteger(clang::ento::nonloc::LocAsInteger)
Unexecuted instantiation: clang::ento::SValVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitNonLocPointerToMember(clang::ento::nonloc::PointerToMember)
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitNonLocCompoundVal(clang::ento::nonloc::CompoundVal)
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitNonLocConcreteInt(clang::ento::nonloc::ConcreteInt)
Line
Count
Source
64
72.0k
  RetTy VisitNonLoc ## Id(nonloc::Id V) { DISPATCH(Parent, Parent); }
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitNonLocLazyCompoundVal(clang::ento::nonloc::LazyCompoundVal)
SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitNonLocLocAsInteger(clang::ento::nonloc::LocAsInteger)
Line
Count
Source
64
3
  RetTy VisitNonLoc ## Id(nonloc::Id V) { DISPATCH(Parent, Parent); }
Unexecuted instantiation: SimpleSValBuilder.cpp:clang::ento::SValVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitNonLocPointerToMember(clang::ento::nonloc::PointerToMember)
65
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
66
67
  // Base case, ignore it. :)
68
  RetTy VisitSVal(SVal V) { return RetTy(); }
69
70
#undef DISPATCH
71
};
72
73
/// SymExprVisitor - this class implements a simple visitor for SymExpr
74
/// subclasses.
75
template <typename ImplClass, typename RetTy = void> class SymExprVisitor {
76
public:
77
78
#define DISPATCH(CLASS) \
79
396k
    return static_cast<ImplClass *>(this)->Visit ## CLASS(cast<CLASS>(S))
80
81
147k
  RetTy Visit(SymbolRef S) {
82
147k
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
147k
    switch (S->getKind()) {
84
147k
#define SYMBOL(Id, Parent) \
85
292k
    
case SymExpr::Id ## Kind: 147k
DISPATCH(Id);
86
147k
#include 
"clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"226
87
147k
    }
88
147k
    
llvm_unreachable0
("Unknown SymExpr kind!");
89
147k
  }
clang::ento::SymExprVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Visit(clang::ento::SymExpr const*)
Line
Count
Source
81
33
  RetTy Visit(SymbolRef S) {
82
33
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
33
    switch (S->getKind()) {
84
33
#define SYMBOL(Id, Parent) \
85
33
    case SymExpr::Id ## Kind: DISPATCH(Id);
86
33
#include 
"clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"0
87
33
    }
88
33
    
llvm_unreachable0
("Unknown SymExpr kind!");
89
  }
ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::Visit(clang::ento::SymExpr const*)
Line
Count
Source
81
618
  RetTy Visit(SymbolRef S) {
82
618
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
618
    switch (S->getKind()) {
84
618
#define SYMBOL(Id, Parent) \
85
618
    case SymExpr::Id ## Kind: DISPATCH(Id);
86
618
#include 
"clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"0
87
618
    }
88
618
    
llvm_unreachable0
("Unknown SymExpr kind!");
89
  }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::Visit(clang::ento::SymExpr const*)
Line
Count
Source
81
146k
  RetTy Visit(SymbolRef S) {
82
146k
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
146k
    switch (S->getKind()) {
84
146k
#define SYMBOL(Id, Parent) \
85
146k
    case SymExpr::Id ## Kind: DISPATCH(Id);
86
146k
#include 
"clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"226
87
146k
    }
88
146k
    
llvm_unreachable0
("Unknown SymExpr kind!");
89
  }
90
91
  // If the implementation chooses not to implement a certain visit method, fall
92
  // back on visiting the superclass.
93
104k
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
Unexecuted instantiation: clang::ento::SymExprVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitIntSymExpr(clang::ento::IntSymExpr const*)
Unexecuted instantiation: clang::ento::SymExprVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitBinarySymExpr(clang::ento::BinarySymExpr const*)
Unexecuted instantiation: clang::ento::SymExprVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitSymbolCast(clang::ento::SymbolCast const*)
Unexecuted instantiation: ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitIntSymExpr(clang::ento::IntSymExpr const*)
Unexecuted instantiation: ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitBinarySymExpr(clang::ento::BinarySymExpr const*)
ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitSymbolConjured(clang::ento::SymbolConjured const*)
Line
Count
Source
93
317
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitSymbolData(clang::ento::SymbolData const*)
Line
Count
Source
93
321
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
Unexecuted instantiation: ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitSymbolDerived(clang::ento::SymbolDerived const*)
Unexecuted instantiation: ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitSymbolExtent(clang::ento::SymbolExtent const*)
Unexecuted instantiation: ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitSymbolMetadata(clang::ento::SymbolMetadata const*)
ExprInspectionChecker.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SymbolExpressor, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::VisitSymbolRegionValue(clang::ento::SymbolRegionValue const*)
Line
Count
Source
93
4
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitIntSymExpr(clang::ento::IntSymExpr const*)
Line
Count
Source
93
226
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitBinarySymExpr(clang::ento::BinarySymExpr const*)
Line
Count
Source
93
226
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitSymbolCast(clang::ento::SymbolCast const*)
Line
Count
Source
93
20
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitSymbolConjured(clang::ento::SymbolConjured const*)
Line
Count
Source
93
65.5k
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitSymbolDerived(clang::ento::SymbolDerived const*)
Line
Count
Source
93
9.81k
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitSymbolExtent(clang::ento::SymbolExtent const*)
Line
Count
Source
93
2.60k
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitSymbolMetadata(clang::ento::SymbolMetadata const*)
Line
Count
Source
93
1.83k
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
SimpleSValBuilder.cpp:clang::ento::SymExprVisitor<(anonymous namespace)::SimpleSValBuilder::simplifySVal(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SVal)::Simplifier, clang::ento::SVal>::VisitSymbolRegionValue(clang::ento::SymbolRegionValue const*)
Line
Count
Source
93
23.2k
#define SYMBOL(Id, Parent) RetTy Visit ## Id(const Id *S) { DISPATCH(Parent); }
94
#define ABSTRACT_SYMBOL(Id, Parent) SYMBOL(Id, Parent)
95
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"
96
97
  // Base case, ignore it. :)
98
  RetTy VisitSymExpr(SymbolRef S) { return RetTy(); }
99
100
#undef DISPATCH
101
};
102
103
/// MemRegionVisitor - this class implements a simple visitor for MemRegion
104
/// subclasses.
105
template <typename ImplClass, typename RetTy = void> class MemRegionVisitor {
106
public:
107
108
#define DISPATCH(CLASS) \
109
86
  return static_cast<ImplClass *>(this)->Visit ## CLASS(cast<CLASS>(R))
110
111
43
  RetTy Visit(const MemRegion *R) {
112
43
    // Dispatch to VisitFooRegion for each FooRegion.
113
43
    switch (R->getKind()) {
114
86
#define REGION(Id, Parent) 
case MemRegion::Id ## Kind: 43
DISPATCH(Id);
115
43
#include 
"clang/StaticAnalyzer/Core/PathSensitive/Regions.def"0
116
43
    }
117
43
    
llvm_unreachable0
("Unknown MemRegion kind!");
118
43
  }
119
120
  // If the implementation chooses not to implement a certain visit method, fall
121
  // back on visiting the superclass.
122
#define REGION(Id, Parent) \
123
0
  RetTy Visit ## Id(const Id *R) { DISPATCH(Parent); }
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitCodeSpaceRegion(clang::ento::CodeSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitMemSpaceRegion(clang::ento::MemSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitGlobalImmutableSpaceRegion(clang::ento::GlobalImmutableSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitNonStaticGlobalSpaceRegion(clang::ento::NonStaticGlobalSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitGlobalsSpaceRegion(clang::ento::GlobalsSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitGlobalInternalSpaceRegion(clang::ento::GlobalInternalSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitGlobalSystemSpaceRegion(clang::ento::GlobalSystemSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitStaticGlobalSpaceRegion(clang::ento::StaticGlobalSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitHeapSpaceRegion(clang::ento::HeapSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitStackArgumentsSpaceRegion(clang::ento::StackArgumentsSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitStackSpaceRegion(clang::ento::StackSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitStackLocalsSpaceRegion(clang::ento::StackLocalsSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitUnknownSpaceRegion(clang::ento::UnknownSpaceRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitBlockDataRegion(clang::ento::BlockDataRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitTypedRegion(clang::ento::TypedRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitSubRegion(clang::ento::SubRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitBlockCodeRegion(clang::ento::BlockCodeRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitCodeTextRegion(clang::ento::CodeTextRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitFunctionCodeRegion(clang::ento::FunctionCodeRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitCXXDerivedObjectRegion(clang::ento::CXXDerivedObjectRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitTypedValueRegion(clang::ento::TypedValueRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitCXXThisRegion(clang::ento::CXXThisRegion const*)
Unexecuted instantiation: clang::ento::MemRegionVisitor<clang::ento::SValExplainer, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VisitObjCStringRegion(clang::ento::ObjCStringRegion const*)
124
#define ABSTRACT_REGION(Id, Parent) \
125
  REGION(Id, Parent)
126
#include "clang/StaticAnalyzer/Core/PathSensitive/Regions.def"
127
128
  // Base case, ignore it. :)
129
  RetTy VisitMemRegion(const MemRegion *R) { return RetTy(); }
130
131
#undef DISPATCH
132
};
133
134
/// FullSValVisitor - a convenient mixed visitor for all three:
135
/// SVal, SymExpr and MemRegion subclasses.
136
template <typename ImplClass, typename RetTy = void>
137
class FullSValVisitor : public SValVisitor<ImplClass, RetTy>,
138
                        public SymExprVisitor<ImplClass, RetTy>,
139
                        public MemRegionVisitor<ImplClass, RetTy> {
140
public:
141
  using SValVisitor<ImplClass, RetTy>::Visit;
142
  using SymExprVisitor<ImplClass, RetTy>::Visit;
143
  using MemRegionVisitor<ImplClass, RetTy>::Visit;
144
};
145
146
} // end namespace ento
147
148
} // end namespace clang
149
150
#endif