1//===- Function.h -----------------------------------------------*- 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//===----------------------------------------------------------------------===// 9#ifndef LLVM_SANDBOXIR_FUNCTION_H 10#define LLVM_SANDBOXIR_FUNCTION_H 18 GlobalObject, llvm::GlobalObject> {
19 /// Helper for mapped_iterator. 22 LLVMBBToBB(
Context &Ctx) : Ctx(Ctx) {}
24return *cast<BasicBlock>(Ctx.
getValue(&LLVMBB));
27 /// Use Context::createFunction() instead. 35returnFrom->getSubclassID() == ClassID::Function;
47size_targ_size()
const{
return cast<llvm::Function>(
Val)->arg_size(); }
48boolarg_empty()
const{
return cast<llvm::Function>(
Val)->arg_empty(); }
52 LLVMBBToBB BBGetter(
Ctx);
56 LLVMBBToBB BBGetter(
Ctx);
63assert(isa<llvm::Function>(
Val) &&
"Expected Function!");
70}
// namespace llvm::sandboxir 72#endif// LLVM_SANDBOXIR_FUNCTION_H 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
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
sandboxir::Value * getValue(llvm::Value *V) const
Module * getModule(llvm::Module *LLVMM) const
Argument * getArg(unsigned Idx) const
FunctionType * getFunctionType() const
void dumpOS(raw_ostream &OS) const final
void dumpNameAndArgs(raw_ostream &OS) const
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.