llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
X86Call Class Referenceabstract

#include <emitter/x86/x86call.h>

Inheritance diagram for X86Call:
Inheritance graph
[legend]
Collaboration diagram for X86Call:
Collaboration graph
[legend]

Public Member Functions

 X86Call (const Func *func)
 Analyses a function for arguments.
 
 X86Call (const CallSite *inst)
 Analyses a call site.
 
 X86Call (const ReturnInst *inst)
 Analyses a return site.
 
 X86Call (const RaiseInst *inst)
 Analyses a raise site.
 
 X86Call (const LandingPadInst *inst)
 Analyses a landing pad.
 
unsigned GetFrameSize () const override
 Returns the number of bytes allocated on the stack.
 
llvm::ArrayRef< unsigned > GetUnusedGPRs () const
 Returns unused GPRs.
 
llvm::ArrayRef< unsigned > GetUsedGPRs () const
 Returns the used GPRs.
 
llvm::ArrayRef< unsigned > GetUnusedXMMs () const
 Returns unused XMMs.
 
llvm::ArrayRef< unsigned > GetUsedXMMs () const
 Returns the used XMMs.
 
- Public Member Functions inherited from CallLowering
 CallLowering (const Func *func)
 
 CallLowering (const CallSite *call)
 
 CallLowering (const RaiseInst *inst)
 
 CallLowering (const LandingPadInst *inst)
 
 CallLowering (const ReturnInst *inst)
 
unsigned GetNumArgs () const
 Returns the number of arguments.
 
arg_iterator arg_begin ()
 
arg_iterator arg_end ()
 
const_arg_iterator arg_begin () const
 
const_arg_iterator arg_end () const
 
llvm::iterator_range< arg_iterator > args ()
 Returns a range over all arguments.
 
llvm::iterator_range< const_arg_iterator > args () const
 Return an immutable range over all arguments.
 
const ArgLocArgument (size_t idx) const
 Returns a given argument.
 
ret_iterator ret_begin ()
 
ret_iterator ret_end ()
 
const_ret_iterator ret_begin () const
 
const_ret_iterator ret_end () const
 
llvm::iterator_range< ret_iterator > rets ()
 Returns a range over all returns.
 
llvm::iterator_range< const_ret_iterator > rets () const
 Return an immutable range over all returns.
 
const RetLocReturn (unsigned idx) const
 Returns the type of a return value.
 

Protected Member Functions

void AssignArgReg (ArgLoc &loc, llvm::MVT t, llvm::Register reg)
 Assigns a location to a register.
 
void AssignArgStack (ArgLoc &loc, llvm::MVT t, unsigned size)
 Assigns a location to the stack.
 
void AssignArgByVal (ArgLoc &loc, llvm::MVT t, unsigned size, llvm::Align a)
 Assigns a location to the stack.
 
void AssignRetReg (RetLoc &loc, llvm::MVT t, llvm::Register reg)
 Assigns a location to a register.
 
virtual llvm::ArrayRef< unsigned > GetGPRs () const =0
 Returns the list of GPR registers.
 
virtual llvm::ArrayRef< unsigned > GetXMMs () const =0
 Returns the list of XMM registers.
 
- Protected Member Functions inherited from CallLowering
virtual void AssignArgC (unsigned i, FlaggedType type)=0
 Location assignment for C.
 
virtual void AssignArgOCaml (unsigned i, FlaggedType type)=0
 Location assignment for Ocaml.
 
virtual void AssignArgOCamlAlloc (unsigned i, FlaggedType type)=0
 Location assignment for OCaml to C allocator calls.
 
virtual void AssignArgOCamlGc (unsigned i, FlaggedType type)=0
 Location assignment for OCaml to GC trampolines.
 
virtual void AssignArgXen (unsigned i, FlaggedType type)=0
 Location assignment for Xen hypercalls.
 
virtual void AssignArgMultiboot (unsigned i, FlaggedType type)
 Location assignment for multiboot.
 
virtual void AssignArgWin64 (unsigned i, FlaggedType type)=0
 Location assignment for Win64.
 
virtual void AssignRetC (unsigned i, FlaggedType type)=0
 Location assignment for C.
 
virtual void AssignRetOCaml (unsigned i, FlaggedType type)=0
 Location assignment for Ocaml.
 
virtual void AssignRetOCamlAlloc (unsigned i, FlaggedType type)=0
 Location assignment for OCaml to C allocator calls.
 
virtual void AssignRetOCamlGc (unsigned i, FlaggedType type)=0
 Location assignment for OCaml to GC trampolines.
 
virtual void AssignRetXen (unsigned i, FlaggedType type)=0
 Location assignment for Xen hypercalls.
 
virtual void AssignRetWin64 (unsigned i, FlaggedType type)=0
 Location assignment for Win64 calls.
 
void AnalyseFunc (const Func *func)
 Analyse a function.
 
void AnalyseCall (const CallSite *call)
 Analyse a call.
 
void AnalyseReturn (const ReturnInst *inst)
 Analyse a return instruction.
 
void AnalyseRaise (const RaiseInst *inst)
 Analyse a raise instruction.
 
void AnalysePad (const LandingPadInst *inst)
 Analyse a landing pad instruction.
 
void AssignArg (unsigned i, FlaggedType type)
 Assigns a location to an argument based on calling conv.
 
void AssignRet (unsigned i, FlaggedType type)
 Assigns a location to a return value based on callig conv.
 

Protected Attributes

unsigned argRegs_ = 0
 Number of arguments in regular registers.
 
unsigned argXMMs_ = 0
 Number of arguments in vector registers.
 
unsigned retRegs_ = 0
 Number of returns in regular registers.
 
unsigned retXMMs_ = 0
 Number of returns in vector registers.
 
unsigned retFPs_ = 0
 Number of returns in floating point registers.
 
unsigned stack_ = 0
 Number of bytes allocated on the stack.
 
llvm::Align maxAlign_ = llvm::Align(8)
 Maximum alignment on the stack.
 
- Protected Attributes inherited from CallLowering
CallingConv conv_
 Calling convention.
 
std::vector< ArgLocargs_
 Locations where arguments are assigned.
 
std::vector< RetLocrets_
 Locations where return values are assigned.
 

Additional Inherited Members

- Public Types inherited from CallLowering
using arg_iterator = std::vector< ArgLoc >::iterator
 
using const_arg_iterator = std::vector< ArgLoc >::const_iterator
 
using ret_iterator = std::vector< RetLoc >::iterator
 
using const_ret_iterator = std::vector< RetLoc >::const_iterator
 

Detailed Description

X86 calling convention analysis.


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