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_REACHABLECODE_H
15 #define LLVM_CLANG_REACHABLECODE_H
17 #include "clang/Basic/SourceLocation.h"
19 //===----------------------------------------------------------------------===//
20 // Forward declarations.
21 //===----------------------------------------------------------------------===//
28 class AnalysisDeclContext;
32 //===----------------------------------------------------------------------===//
34 //===----------------------------------------------------------------------===//
37 namespace reachable_code {
40 virtual void anchor();
42 virtual ~Callback() {}
43 virtual void HandleUnreachable(SourceLocation L, SourceRange R1,
47 /// ScanReachableFromBlock - Mark all blocks reachable from Start.
48 /// Returns the total number of blocks that were marked reachable.
49 unsigned ScanReachableFromBlock(const CFGBlock *Start,
50 llvm::BitVector &Reachable);
52 void FindUnreachableCode(AnalysisDeclContext &AC, Callback &CB);
54 }} // end namespace clang::reachable_code