14#ifndef LLVM_CODEGEN_INDIRECTTHUNKS_H
15#define LLVM_CODEGEN_INDIRECTTHUNKS_H
24template <
typename Derived,
typename InsertedThunksTy =
bool>
26 Derived &getDerived() {
return *
static_cast<Derived *
>(
this); }
41 getDerived().doInitialization(M);
47template <
typename Derived,
typename InsertedThunksTy>
51 assert(
Name.startswith(getDerived().getThunkPrefix()) &&
52 "Created a thunk with an unexpected prefix!");
63 F->setComdat(M.getOrInsertComdat(
Name));
69 B.addAttribute(llvm::Attribute::NoUnwind);
70 B.addAttribute(llvm::Attribute::Naked);
71 if (TargetAttrs !=
"")
72 B.addAttribute(
"target-features", TargetAttrs);
93template <
typename Derived,
typename InsertedThunksTy>
107 if (!getDerived().mayUseThunk(MF, InsertedThunks))
110 InsertedThunks |= getDerived().insertThunks(MMI, MF);
115 getDerived().populateThunk(MF);
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Module.h This file contains the declarations for the Module class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Basic Block Representation.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
@ HiddenVisibility
The GV is hidden.
@ InternalLinkage
Rename collisions when linking (static functions).
@ LinkOnceODRLinkage
Same, but only replaced by something equivalent.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
This is an important class for using LLVM in a threaded context.
MachineFunctionProperties & set(Property P)
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
const MachineFunctionProperties & getProperties() const
Get the function properties.
This class contains meta information specific to a module.
const Module * getModule() const
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
bool startswith(StringRef Prefix) const
void createThunkFunction(MachineModuleInfo &MMI, StringRef Name, bool Comdat=true, StringRef TargetAttrs="")
bool run(MachineModuleInfo &MMI, MachineFunction &MF)
void doInitialization(Module &M)
InsertedThunksTy InsertedThunks
The instances of the Type class are immutable: once they are created, they are never changed.
static Type * getVoidTy(LLVMContext &C)
This is an optimization pass for GlobalISel generic memory operations.