1 //===- Transforms/Instrumentation/InstrProfiling.h --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 /// This file provides the interface for LLVM's PGO Instrumentation lowering
10 /// pass.
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H
14 #define LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H
15 
16 #include "llvm/IR/PassManager.h"
17 #include "llvm/Transforms/Instrumentation.h"
18 
19 namespace llvm {
20 
21 class TargetLibraryInfo;
22 /// Instrumentation based profiling lowering pass. This pass lowers
23 /// the profile instrumented code generated by FE or the IR based
24 /// instrumentation pass.
25 class InstrProfilingLoweringPass
26     : public PassInfoMixin<InstrProfilingLoweringPass> {
27   const InstrProfOptions Options = {};
28   // Is this lowering for the context-sensitive instrumentation.
29   const bool IsCS = false;
30 
31 public:
32   InstrProfilingLoweringPass() = default;
33   InstrProfilingLoweringPass(const InstrProfOptions &Options, bool IsCS = false)
Options(Options)34       : Options(Options), IsCS(IsCS) {}
35 
36   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
37 };
38 } // end namespace llvm
39 
40 #endif // LLVM_TRANSFORMS_INSTRUMENTATION_INSTRPROFILING_H
41