1//===- PassInstrumentation.cpp - Pass Instrumentation interface -*- C++ -*-===// 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 7//===----------------------------------------------------------------------===// 10/// This file provides the implementation of PassInstrumentation class. 12//===----------------------------------------------------------------------===// 20templatestructLLVM_EXPORT_TEMPLATE Any::TypeId<const Module *>;
21templatestructLLVM_EXPORT_TEMPLATE Any::TypeId<const Function *>;
22templatestructLLVM_EXPORT_TEMPLATE Any::TypeId<const Loop *>;
26 ClassToPassName.try_emplace(ClassName,
PassName.str());
31if (!ClassToPassNameCallbacks.
empty()) {
32for (
auto &Fn : ClassToPassNameCallbacks)
34 ClassToPassNameCallbacks.clear();
36return ClassToPassName[ClassName];
42size_t Pos = PassID.
find(
'<');
45 Prefix = PassID.
substr(0, Pos);
47 [Prefix](
StringRef S) {
return Prefix.ends_with(S); });
This header defines various interfaces for pass management in LLVM.
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
This file contains some templates that are useful if you are working with the STL at all.
static const char PassName[]
StringRef - Represent a constant reference to a string, i.e.
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
static constexpr size_t npos
This is an optimization pass for GlobalISel generic memory operations.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
bool isSpecialPass(StringRef PassID, const std::vector< StringRef > &Specials)
A special type used by analysis passes to provide an address that identifies that particular analysis...
StringRef getPassNameForClassName(StringRef ClassName)
Get the pass name for a given pass class name.
void addClassToPassName(StringRef ClassName, StringRef PassName)
Add a class name to pass name mapping for use by pass instrumentation.