clang  10.0.0svn
Public Types | Public Member Functions | Friends | List of all members
clang::interp::Function Class Reference

Bytecode function. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/AST/Interp/Function.h"

Public Types

using ParamDescriptor = std::pair< PrimType, Descriptor * >
 
using arg_reverse_iterator = SmallVectorImpl< PrimType >::reverse_iterator
 Range over argument types. More...
 

Public Member Functions

unsigned getFrameSize () const
 Returns the size of the function's local stack. More...
 
unsigned getArgSize () const
 Returns the size of the argument stackx. More...
 
CodePtr getCodeBegin () const
 Returns a pointer to the start of the code. More...
 
CodePtr getCodeEnd () const
 Returns a pointer to the end of the code. More...
 
const FunctionDeclgetDecl () const
 Returns the original FunctionDecl. More...
 
SourceLocation getLoc () const
 Returns the lcoation. More...
 
ParamDescriptor getParamDescriptor (unsigned Offset) const
 Returns a parameter descriptor. More...
 
bool hasRVO () const
 Checks if the first argument is a RVO pointer. More...
 
llvm::iterator_range< llvm::SmallVector< Scope, 2 >::iterator > scopes ()
 Range over the scope blocks. More...
 
llvm::iterator_range< arg_reverse_iteratorargs_reverse ()
 
ScopegetScope (unsigned Idx)
 Returns a specific scope. More...
 
SourceInfo getSource (CodePtr PC) const
 Returns the source information at a given PC. More...
 
bool isConstexpr () const
 Checks if the function is valid to call in constexpr. More...
 
bool isVirtual () const
 Checks if the function is virtual. More...
 
bool isConstructor () const
 Checks if the function is a constructor. More...
 
void dump () const
 Dumps the disassembled bytecode to llvm::errs(). More...
 
void dump (llvm::raw_ostream &OS) const
 

Friends

class Program
 
class ByteCodeEmitter
 

Detailed Description

Bytecode function.

Contains links to the bytecode of the function, as well as metadata describing all arguments and stack-local variables.

Definition at line 59 of file Function.h.

Member Typedef Documentation

◆ arg_reverse_iterator

Range over argument types.

Definition at line 91 of file Function.h.

◆ ParamDescriptor

Definition at line 61 of file Function.h.

Member Function Documentation

◆ args_reverse()

llvm::iterator_range<arg_reverse_iterator> clang::interp::Function::args_reverse ( )
inline

Definition at line 92 of file Function.h.

Referenced by clang::interp::InterpFrame::popArgs().

◆ dump() [1/2]

LLVM_DUMP_METHOD void Function::dump ( ) const

Dumps the disassembled bytecode to llvm::errs().

Definition at line 23 of file Disasm.cpp.

Referenced by clang::interp::Program::dump().

◆ dump() [2/2]

LLVM_DUMP_METHOD void Function::dump ( llvm::raw_ostream &  OS) const

Definition at line 25 of file Disasm.cpp.

◆ getArgSize()

unsigned clang::interp::Function::getArgSize ( ) const
inline

Returns the size of the argument stackx.

Definition at line 66 of file Function.h.

◆ getCodeBegin()

CodePtr Function::getCodeBegin ( ) const

Returns a pointer to the start of the code.

Definition at line 24 of file Function.cpp.

Referenced by clang::interp::InterpFrame::getPC().

◆ getCodeEnd()

CodePtr Function::getCodeEnd ( ) const

Returns a pointer to the end of the code.

Definition at line 26 of file Function.cpp.

◆ getDecl()

const FunctionDecl* clang::interp::Function::getDecl ( ) const
inline

Returns the original FunctionDecl.

Definition at line 74 of file Function.h.

Referenced by clang::interp::InterpFrame::getCallee().

◆ getFrameSize()

unsigned clang::interp::Function::getFrameSize ( ) const
inline

Returns the size of the function's local stack.

Definition at line 64 of file Function.h.

◆ getLoc()

SourceLocation clang::interp::Function::getLoc ( ) const
inline

Returns the lcoation.

Definition at line 77 of file Function.h.

References clang::interp::Scope::Local::Offset.

◆ getParamDescriptor()

Function::ParamDescriptor Function::getParamDescriptor ( unsigned  Offset) const

Returns a parameter descriptor.

Definition at line 28 of file Function.cpp.

Referenced by clang::interp::InterpFrame::getParamPointer().

◆ getScope()

Scope& clang::interp::Function::getScope ( unsigned  Idx)
inline

Returns a specific scope.

Definition at line 97 of file Function.h.

Referenced by clang::interp::InterpFrame::destroy().

◆ getSource()

SourceInfo Function::getSource ( CodePtr  PC) const

Returns the source information at a given PC.

Definition at line 34 of file Function.cpp.

References Offset.

Referenced by clang::interp::EvalEmitter::getSource(), and clang::interp::InterpState::getSource().

◆ hasRVO()

bool clang::interp::Function::hasRVO ( ) const
inline

Checks if the first argument is a RVO pointer.

Definition at line 83 of file Function.h.

Referenced by clang::interp::InterpFrame::describe().

◆ isConstexpr()

bool clang::interp::Function::isConstexpr ( ) const
inline

Checks if the function is valid to call in constexpr.

Definition at line 103 of file Function.h.

Referenced by clang::interp::Context::isPotentialConstantExpr().

◆ isConstructor()

bool clang::interp::Function::isConstructor ( ) const
inline

Checks if the function is a constructor.

Definition at line 109 of file Function.h.

References P.

Referenced by clang::interp::InterpFrame::~InterpFrame().

◆ isVirtual()

bool Function::isVirtual ( ) const

Checks if the function is virtual.

Definition at line 44 of file Function.cpp.

◆ scopes()

llvm::iterator_range<llvm::SmallVector<Scope, 2>::iterator> clang::interp::Function::scopes ( )
inline

Range over the scope blocks.

Definition at line 86 of file Function.h.

Friends And Related Function Documentation

◆ ByteCodeEmitter

friend class ByteCodeEmitter
friend

Definition at line 129 of file Function.h.

◆ Program

friend class Program
friend

Definition at line 128 of file Function.h.


The documentation for this class was generated from the following files: