1//===----------------------------------------------------------------------===//
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/// This file contains the registry for PassConfigCallbacks that enable changes
10/// to the TargetPassConfig during the initialization of TargetMachine.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TARGET_REGISTERTARGETPASSCONFIGCALLBACK_H
15#define LLVM_TARGET_REGISTERTARGETPASSCONFIGCALLBACK_H
16
17#include "TargetMachine.h"
18#include "llvm/Support/Compiler.h"
19
20namespace llvm {
21
22using PassConfigCallback =
23 std::function<void(TargetMachine &, PassManagerBase &, TargetPassConfig *)>;
24
25class RegisterTargetPassConfigCallback {
26public:
27 PassConfigCallback Callback;
28
29 LLVM_ABI explicit RegisterTargetPassConfigCallback(PassConfigCallback &&C);
30 LLVM_ABI ~RegisterTargetPassConfigCallback();
31};
32
33LLVM_ABI void
34invokeGlobalTargetPassConfigCallbacks(TargetMachine &TM, PassManagerBase &PM,
35 TargetPassConfig *PassConfig);
36} // namespace llvm
37
38#endif // LLVM_TARGET_REGISTERTARGETPASSCONFIGCALLBACK_H
39