1//===- Function.cpp - The Function class of Sandbox IR --------------------===// 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//===----------------------------------------------------------------------===// 16return cast<FunctionType>(
22auto *
F = cast<llvm::Function>(
Val);
23OS << *
F->getReturnType() <<
" @" <<
F->getName() <<
"(";
27 auto *SBArg = cast_or_null<Argument>(Ctx.getValue(&LLVMArg));
31 SBArg->printAsOperand(OS);
40auto *LLVMF = cast<llvm::Function>(
Val);
44auto *BB = cast_or_null<BasicBlock>(
Ctx.
getValue(&LLVMBB));
55}
// namespace llvm::sandboxir 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.
sandboxir::Value * getValue(llvm::Value *V) const
Type * getType(llvm::Type *LLVMTy)
FunctionType * getFunctionType() const
void dumpOS(raw_ostream &OS) const final
void dumpNameAndArgs(raw_ostream &OS) const
llvm::Value * Val
The LLVM Value that corresponds to this SandboxIR Value.
Context & Ctx
All values point to the context.
void interleave(ForwardIterator begin, ForwardIterator end, UnaryFunctor each_fn, NullaryFunctor between_fn)
An STL-style algorithm similar to std::for_each that applies a second functor between every pair of e...