9#ifndef LLVM_SANDBOXIR_FUNCTION_H
10#define LLVM_SANDBOXIR_FUNCTION_H
19 GlobalObject, llvm::GlobalObject> {
23 LLVMBBToBB(
Context &Ctx) : Ctx(Ctx) {}
25 return *cast<BasicBlock>(Ctx.
getValue(&LLVMBB));
36 return From->getSubclassID() == ClassID::Function;
48 size_t arg_size()
const {
return cast<llvm::Function>(
Val)->arg_size(); }
49 bool arg_empty()
const {
return cast<llvm::Function>(
Val)->arg_empty(); }
53 LLVMBBToBB BBGetter(
Ctx);
57 LLVMBBToBB BBGetter(
Ctx);
74 assert(isa<llvm::Function>(
Val) &&
"Expected Function!");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
BlockVerifier::State From
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This class represents an incoming formal argument to a Function.
LLVM Basic Block Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
Argument of a sandboxir::Function.
Contains a list of sandboxir::Instruction's.
LLVM_ABI sandboxir::Value * getValue(llvm::Value *V) const
LLVM_ABI Module * getModule(llvm::Module *LLVMM) const
Argument * getArg(unsigned Idx) const
LLVM_ABI FunctionType * getFunctionType() const
void dumpOS(raw_ostream &OS) const final
LLVM_ABI void setAlignment(MaybeAlign Align)
Sets the alignment attribute of the Function.
void dumpNameAndArgs(raw_ostream &OS) const
MaybeAlign getAlign() const
Returns the alignment of the given function.
void verify() const final
Should crash if there is something wrong with the instruction.
static bool classof(const sandboxir::Value *From)
For isa/dyn_cast.
mapped_iterator< llvm::Function::iterator, LLVMBBToBB > iterator
Provides API functions, like getIterator() and getReverseIterator() to GlobalIFunc,...
In SandboxIR the Module is mainly used to access the list of global objects.
A SandboxIR Value has users. This is the base class.
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
Context & Ctx
All values point to the context.
This struct is a compact representation of a valid (non-zero power of two) alignment.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.