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 AnalysisContext;
32 //===----------------------------------------------------------------------===//
34 //===----------------------------------------------------------------------===//
37 namespace reachable_code {
41 virtual ~Callback() {}
42 virtual void HandleUnreachable(SourceLocation L, SourceRange R1,
46 /// ScanReachableFromBlock - Mark all blocks reachable from Start.
47 /// Returns the total number of blocks that were marked reachable.
48 unsigned ScanReachableFromBlock(const CFGBlock *Start,
49 llvm::BitVector &Reachable);
51 void FindUnreachableCode(AnalysisContext &AC, Callback &CB);
53 }} // end namespace clang::reachable_code