clang
3.9.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
llvm.src
tools
clang
include
clang
Analysis
Analyses
ReachableCode.h
Go to the documentation of this file.
1
//===- ReachableCode.h -----------------------------------------*- C++ --*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// A flow-sensitive, path-insensitive analysis of unreachable code.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_REACHABLECODE_H
15
#define LLVM_CLANG_ANALYSIS_ANALYSES_REACHABLECODE_H
16
17
#include "
clang/Basic/SourceLocation.h
"
18
19
//===----------------------------------------------------------------------===//
20
// Forward declarations.
21
//===----------------------------------------------------------------------===//
22
23
namespace
llvm {
24
class
BitVector;
25
}
26
27
namespace
clang {
28
class
AnalysisDeclContext;
29
class
CFGBlock;
30
class
Preprocessor;
31
}
32
33
//===----------------------------------------------------------------------===//
34
// API.
35
//===----------------------------------------------------------------------===//
36
37
namespace
clang {
38
namespace
reachable_code {
39
40
/// Classifications of unreachable code.
41
enum
UnreachableKind
{
42
UK_Return
,
43
UK_Break
,
44
UK_Loop_Increment
,
45
UK_Other
46
};
47
48
class
Callback
{
49
virtual
void
anchor();
50
public
:
51
virtual
~Callback
() {}
52
virtual
void
HandleUnreachable
(
UnreachableKind
UK,
53
SourceLocation
L,
54
SourceRange
ConditionVal,
55
SourceRange
R1,
56
SourceRange
R2) = 0;
57
};
58
59
/// ScanReachableFromBlock - Mark all blocks reachable from Start.
60
/// Returns the total number of blocks that were marked reachable.
61
unsigned
ScanReachableFromBlock
(
const
CFGBlock
*Start,
62
llvm::BitVector &Reachable);
63
64
void
FindUnreachableCode
(
AnalysisDeclContext
&AC,
Preprocessor
&PP,
65
Callback
&CB);
66
67
}}
// end namespace clang::reachable_code
68
69
#endif
clang::reachable_code::Callback::HandleUnreachable
virtual void HandleUnreachable(UnreachableKind UK, SourceLocation L, SourceRange ConditionVal, SourceRange R1, SourceRange R2)=0
clang::reachable_code::Callback
Definition:
ReachableCode.h:48
clang::AnalysisDeclContext
AnalysisDeclContext contains the context data for the function or method under analysis.
Definition:
AnalysisContext.h:66
clang::reachable_code::UK_Other
Definition:
ReachableCode.h:45
clang::CFGBlock
CFGBlock - Represents a single basic block in a source-level CFG.
Definition:
CFG.h:353
clang::reachable_code::UK_Return
Definition:
ReachableCode.h:42
Callback
MatchFinder::MatchCallback * Callback
Definition:
ASTMatchFinder.cpp:710
clang::reachable_code::FindUnreachableCode
void FindUnreachableCode(AnalysisDeclContext &AC, Preprocessor &PP, Callback &CB)
Definition:
ReachableCode.cpp:637
clang::reachable_code::ScanReachableFromBlock
unsigned ScanReachableFromBlock(const CFGBlock *Start, llvm::BitVector &Reachable)
ScanReachableFromBlock - Mark all blocks reachable from Start.
Definition:
ReachableCode.cpp:632
clang::reachable_code::UK_Break
Definition:
ReachableCode.h:43
clang::SourceLocation
Encodes a location in the source.
Definition:
SourceLocation.h:88
clang::reachable_code::UK_Loop_Increment
Definition:
ReachableCode.h:44
clang::reachable_code::UnreachableKind
UnreachableKind
Classifications of unreachable code.
Definition:
ReachableCode.h:41
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::SourceRange
A trivial tuple used to represent a source range.
Definition:
SourceLocation.h:193
clang::reachable_code::Callback::~Callback
virtual ~Callback()
Definition:
ReachableCode.h:51
clang::Preprocessor
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition:
Preprocessor.h:97
Generated on Wed Aug 31 2016 16:58:10 for clang by
1.8.6