1 //===- CountVisits.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 
9 #ifndef LLVM_TRANSFORMS_UTILS_COUNT_VISITS_H
10 #define LLVM_TRANSFORMS_UTILS_COUNT_VISITS_H
11 
12 #include "llvm/ADT/StringMap.h"
13 #include "llvm/IR/PassManager.h"
14 
15 namespace llvm {
16 
17 class Function;
18 
19 struct CountVisitsPass : PassInfoMixin<CountVisitsPass> {
20   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
21 
22 private:
23   StringMap<uint32_t> Counts;
24 };
25 
26 } // end namespace llvm
27 
28 #endif // LLVM_TRANSFORMS_UTILS_COUNT_VISITS_H
29