LLVM: lib/SandboxIR/Function.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

12

14

16 return cast(

17 Ctx.getType(castllvm::Function(Val)->getFunctionType()));

18}

19

20#ifndef NDEBUG

22 auto *F = castllvm::Function(Val);

23 OS << *F->getReturnType() << " @" << F->getName() << "(";

25 F->args(),

27 auto *SBArg = cast_or_null(Ctx.getValue(&LLVMArg));

28 if (SBArg == nullptr)

29 OS << "NULL";

30 else

31 SBArg->printAsOperand(OS);

32 },

33 [&] { OS << ", "; });

34 OS << ")";

35}

36

39 OS << " {\n";

40 auto *LLVMF = castllvm::Function(Val);

42 *LLVMF,

44 auto *BB = cast_or_null(Ctx.getValue(&LLVMBB));

45 if (BB == nullptr)

46 OS << "NULL";

47 else

48 OS << *BB;

49 },

50 [&OS] { OS << "\n"; });

51 OS << "}\n";

52}

53#endif

54

55}

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...