Coverage Report

Created: 2020-02-25 14:32

/Users/buildslave/jenkins/workspace/coverage/llvm-project/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
403k
  return static_cast<ImplClass *>(this)->Visit ## NAME(V.castAs<CLASS>())
32
33
155k
  RetTy Visit(SVal V) {
34
155k
    // Dispatch to VisitFooVal for each FooVal.
35
155k
    // Take namespaces (loc:: and nonloc::) into account.
36
155k
    switch (V.getBaseKind()) {
37
1
#define BASIC_SVAL(Id, Parent) case SVal::Id ## Kind: 
DISPATCH0
(Id, Id);
38
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
39
25
    case SVal::LocKind:
40
25
      switch (V.getSubKind()) {
41
0
#define LOC_SVAL(Id, Parent) \
42
25
      case loc::Id ## Kind: DISPATCH(Loc ## Id, loc :: Id);
43
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
44
25
      }
45
25
      
llvm_unreachable0
("Unknown Loc sub-kind!");
46
155k
    case SVal::NonLocKind:
47
155k
      switch (V.getSubKind()) {
48
0
#define NONLOC_SVAL(Id, Parent) \
49
155k
      case nonloc::Id ## Kind: 
DISPATCH80.6k
(NonLoc ## Id, nonloc :: Id);
50
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
51
155k
      }
52
155k
      
llvm_unreachable0
("Unknown NonLoc sub-kind!");
53
155k
    }
54
155k
    
llvm_unreachable0
("Unknown SVal kind!");
55
155k
  }
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
0
#define BASIC_SVAL(Id, Parent) case SVal::Id ## Kind: DISPATCH(Id, Id);
38
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
39
25
    case SVal::LocKind:
40
25
      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
25
      }
45
25
      
llvm_unreachable0
("Unknown Loc sub-kind!");
46
25
    case SVal::NonLocKind:
47
20
      switch (V.getSubKind()) {
48
0
#define NONLOC_SVAL(Id, Parent) \
49
0
      case nonloc::Id ## Kind: DISPATCH(NonLoc ## Id, nonloc :: Id);
50
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
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
155k
  RetTy Visit(SVal V) {
34
155k
    // Dispatch to VisitFooVal for each FooVal.
35
155k
    // Take namespaces (loc:: and nonloc::) into account.
36
155k
    switch (V.getBaseKind()) {
37
0
#define BASIC_SVAL(Id, Parent) case SVal::Id ## Kind: DISPATCH(Id, Id);
38
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
39
0
    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
155k
    case SVal::NonLocKind:
47
155k
      switch (V.getSubKind()) {
48
0
#define NONLOC_SVAL(Id, Parent) \
49
0
      case nonloc::Id ## Kind: DISPATCH(NonLoc ## Id, nonloc :: Id);
50
0
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def"
51
155k
      }
52
155k
      
llvm_unreachable0
("Unknown NonLoc sub-kind!");
53
155k
    }
54
155k
    
llvm_unreachable0
("Unknown SVal kind!");
55
  }
56
57
#define BASIC_SVAL(Id, Parent) \
58
241k
  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)
Unexecuted instantiation: 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)
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
80.6k
  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
80.6k
  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
80.6k
  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
80.6k
  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
80.6k
  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
15
  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
270k
    return static_cast<ImplClass *>(this)->Visit ## CLASS(cast<CLASS>(S))
80
81
157k
  RetTy Visit(SymbolRef S) {
82
157k
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
157k
    switch (S->getKind()) {
84
0
#define SYMBOL(Id, Parent) \
85
157k
    case SymExpr::Id ## Kind: 
DISPATCH155k
(Id);
86
0
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"
87
157k
    }
88
157k
    
llvm_unreachable0
("Unknown SymExpr kind!");
89
157k
  }
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
0
#define SYMBOL(Id, Parent) \
85
0
    case SymExpr::Id ## Kind: DISPATCH(Id);
86
0
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"
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
1.14k
  RetTy Visit(SymbolRef S) {
82
1.14k
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
1.14k
    switch (S->getKind()) {
84
0
#define SYMBOL(Id, Parent) \
85
0
    case SymExpr::Id ## Kind: DISPATCH(Id);
86
0
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"
87
1.14k
    }
88
1.14k
    
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
156k
  RetTy Visit(SymbolRef S) {
82
156k
    // Dispatch to VisitSymbolFoo for each SymbolFoo.
83
156k
    switch (S->getKind()) {
84
0
#define SYMBOL(Id, Parent) \
85
0
    case SymExpr::Id ## Kind: DISPATCH(Id);
86
0
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"
87
156k
    }
88
156k
    
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
114k
#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
762
#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
766
#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
242
#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
242
#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
14
#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
74.6k
#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.96k
#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.70k
#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.77k
#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.4k
#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
43
  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
43
#define REGION(Id, Parent) case MemRegion::Id ## Kind: DISPATCH(Id);
115
0
#include "clang/StaticAnalyzer/Core/PathSensitive/Regions.def"
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