LLVM 22.0.0git
RegisterTargetPassConfigCallback.cpp
Go to the documentation of this file.
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
15
16namespace llvm {
17// TargetPassConfig callbacks
18static SmallVector<RegisterTargetPassConfigCallback *, 1>
20
23 TargetPassConfig *PassConfig) {
25 Reg->Callback(TM, PM, PassConfig);
26}
27
30 : Callback(std::move(C)) {
31 TargetPassConfigCallbacks.push_back(this);
32}
33
35 const auto &It = find(TargetPassConfigCallbacks, this);
36 if (It != TargetPassConfigCallbacks.end())
38}
39} // namespace llvm
Register Reg
LLVM_ABI RegisterTargetPassConfigCallback(PassConfigCallback &&C)
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:83
Target-Independent Code Generator Pass Configuration Options.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1770
LLVM_ABI void invokeGlobalTargetPassConfigCallbacks(TargetMachine &TM, PassManagerBase &PM, TargetPassConfig *PassConfig)
static SmallVector< RegisterTargetPassConfigCallback *, 1 > TargetPassConfigCallbacks
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1886
std::function< void(TargetMachine &, PassManagerBase &, TargetPassConfig *)> PassConfigCallback
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:851