1 //===- ReachableCode.h -----------------------------------------*- C++ --*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // A flow-sensitive, path-insensitive analysis of unreachable code.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_REACHABLECODE_H
15 #define LLVM_CLANG_ANALYSIS_ANALYSES_REACHABLECODE_H
17 #include "clang/Basic/SourceLocation.h"
19 //===----------------------------------------------------------------------===//
20 // Forward declarations.
21 //===----------------------------------------------------------------------===//
28 class AnalysisDeclContext;
33 //===----------------------------------------------------------------------===//
35 //===----------------------------------------------------------------------===//
38 namespace reachable_code {
40 /// Classifications of unreachable code.
41 enum UnreachableKind {
49 virtual void anchor();
51 virtual ~Callback() {}
52 virtual void HandleUnreachable(UnreachableKind UK,
54 SourceRange ConditionVal,
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);
64 void FindUnreachableCode(AnalysisDeclContext &AC, Preprocessor &PP,
67 }} // end namespace clang::reachable_code