LLVM 24.0.0git
RuntimeLibcallInfo.h
Go to the documentation of this file.
1//===-- RuntimeLibcallInfo.h - Runtime library information ------*- 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_ANALYSIS_RUNTIMELIBCALLINFO_H
10#define LLVM_ANALYSIS_RUNTIMELIBCALLINFO_H
11
13#include "llvm/Pass.h"
14#include <optional>
15#include <string>
16
17namespace llvm {
18
20 : public AnalysisInfoMixin<RuntimeLibraryAnalysis> {
21public:
23
26 EABI EABIVersion = EABI::Default,
27 StringRef ABIName = "",
29 : ExceptionModel(ExceptionModel), EABIVersion(EABIVersion),
30 ABIName(ABIName.str()), VecLib(VecLib) {}
31
33
34private:
36 static AnalysisKey Key;
37
38 // FIXME: These are TargetOptions values that are not yet represented in the
39 // IR, copied here so run() can forward them to the RuntimeLibcallsInfo Module
40 // constructor. Delete each one as they are migrated to module flags.
42 EABI EABIVersion = EABI::Default;
43 std::string ABIName;
45};
46
49 std::optional<RTLIB::RuntimeLibcallsInfo> RTLCI;
50
51public:
52 static char ID;
55 EABI EABIVersion = EABI::Default,
56 StringRef ABIName = "",
58
60 if (!RTLCI) {
61 ModuleAnalysisManager DummyMAM;
62 RTLCI = RTLA.run(M, DummyMAM);
63 }
64
65 return *RTLCI;
66 }
67
68 void getAnalysisUsage(AnalysisUsage &AU) const override;
69};
70
72
73} // namespace llvm
74
75#endif
#define LLVM_ABI
Definition Compiler.h:215
Represent the analysis usage information of a pass.
ImmutablePass(char &pid)
Definition Pass.h:287
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
RuntimeLibraryAnalysis(ExceptionHandling ExceptionModel, EABI EABIVersion=EABI::Default, StringRef ABIName="", VectorLibrary VecLib=VectorLibrary::NoLibrary)
RTLIB::RuntimeLibcallsInfo Result
const RTLIB::RuntimeLibcallsInfo & getRTLCI(const Module &M)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI ModulePass * createRuntimeLibraryInfoWrapperPass()
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
ExceptionHandling
Definition CodeGen.h:54
@ None
No exception support.
Definition CodeGen.h:55
VectorLibrary
List of known vector-functions libraries.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
A simple container for information about the supported runtime calls.