1 //===-- DebugInfoProbe.h - DebugInfo Probe ----------------------*- 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 // This file defines a probe, DebugInfoProbe, that can be used by pass
11 // manager to analyze how optimizer is treating debugging information.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TRANSFORMS_UTILS_DEBUGINFOPROBE_H
16 #define LLVM_TRANSFORMS_UTILS_DEBUGINFOPROBE_H
18 #include "llvm/ADT/StringMap.h"
23 class DebugInfoProbeImpl;
25 /// DebugInfoProbe - This class provides a interface to monitor
26 /// how an optimization pass is preserving debugging information.
27 class DebugInfoProbe {
32 /// initialize - Collect information before running an optimization pass.
33 void initialize(StringRef PName, Function &F);
35 /// finalize - Collect information after running an optimization pass. This
36 /// must be used after initialization.
37 void finalize(Function &F);
39 /// report - Report findings. This should be invoked after finalize.
43 DebugInfoProbeImpl *pImpl;
46 /// DebugInfoProbeInfo - This class provides an interface that a pass manager
47 /// can use to manage debug info probes.
48 class DebugInfoProbeInfo {
49 StringMap<DebugInfoProbe *> Probes;
51 DebugInfoProbeInfo() {}
53 /// ~DebugInfoProbeInfo - Report data collected by all probes before deleting
55 ~DebugInfoProbeInfo();
57 /// initialize - Collect information before running an optimization pass.
58 void initialize(Pass *P, Function &F);
60 /// finalize - Collect information after running an optimization pass. This
61 /// must be used after initialization.
62 void finalize(Pass *P, Function &F);
65 } // End llvm namespace