Jlm
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
jlm::llvm::CallTypeClassifier Class Referencefinal

Call node classifier. More...

#include <call.hpp>

Collaboration diagram for jlm::llvm::CallTypeClassifier:
Collaboration graph
[legend]

Public Types

enum class  CallType { NonRecursiveDirectCall , RecursiveDirectCall , ExternalCall , IndirectCall }
 

Public Member Functions

 CallTypeClassifier (CallType callType, jlm::rvsdg::Output &output)
 
CallType GetCallType () const noexcept
 Return call type. More...
 
bool IsNonRecursiveDirectCall () const noexcept
 Determines whether call is a non-recursive direct call. More...
 
bool IsRecursiveDirectCall () const noexcept
 Determines whether call is a recursive direct call. More...
 
bool IsDirectCall () const noexcept
 
bool IsExternalCall () const noexcept
 Determines whether call is an external call. More...
 
bool IsIndirectCall () const noexcept
 Determines whether call is an indirect call. More...
 
rvsdg::OutputGetLambdaOutput () const noexcept
 Returns the called function. More...
 
rvsdg::RegionArgumentGetImport () const noexcept
 Returns the imported function. More...
 
jlm::rvsdg::OutputGetFunctionOrigin () const noexcept
 Return origin of a call node's function input. More...
 
bool isSetjmpCall ()
 
bool isVaStartCall ()
 

Static Public Member Functions

static std::unique_ptr< CallTypeClassifierCreateNonRecursiveDirectCallClassifier (rvsdg::Output &output)
 Classify callee as non-recursive. More...
 
static std::unique_ptr< CallTypeClassifierCreateRecursiveDirectCallClassifier (rvsdg::Output &output)
 Classify callee as recursive. More...
 
static std::unique_ptr< CallTypeClassifierCreateExternalCallClassifier (rvsdg::RegionArgument &argument)
 Classify callee as external. More...
 
static std::unique_ptr< CallTypeClassifierCreateIndirectCallClassifier (jlm::rvsdg::Output &output)
 Classify callee as inderict. More...
 

Private Attributes

CallType CallType_
 
jlm::rvsdg::OutputOutput_
 

Detailed Description

Call node classifier.

The CallTypeClassifier class provides information about the call type of a call node.

Definition at line 23 of file call.hpp.

Member Enumeration Documentation

◆ CallType

Enumerator
NonRecursiveDirectCall 

A call to a statically visible function within the module that is not part of a mutual recursive call chain.

RecursiveDirectCall 

A call to a statically visible function within the module that is part of a mutual recursive call chain.

ExternalCall 

A direct call to an imported function, i.e., a function from outside the current module.

IndirectCall 

A call to a statically not visible function.

Definition at line 26 of file call.hpp.

Constructor & Destructor Documentation

◆ CallTypeClassifier()

jlm::llvm::CallTypeClassifier::CallTypeClassifier ( CallType  callType,
jlm::rvsdg::Output output 
)
inline

Definition at line 51 of file call.hpp.

Member Function Documentation

◆ CreateExternalCallClassifier()

static std::unique_ptr<CallTypeClassifier> jlm::llvm::CallTypeClassifier::CreateExternalCallClassifier ( rvsdg::RegionArgument argument)
inlinestatic

Classify callee as external.

Parameters
argumentOutput representing the function called (must be graph argument).
Precondition
The given output must be an argument to the root region of the graph.

Definition at line 222 of file call.hpp.

◆ CreateIndirectCallClassifier()

static std::unique_ptr<CallTypeClassifier> jlm::llvm::CallTypeClassifier::CreateIndirectCallClassifier ( jlm::rvsdg::Output output)
inlinestatic

Classify callee as inderict.

Parameters
outputOutput representing the function called (supposed to be pointer).

Definition at line 235 of file call.hpp.

◆ CreateNonRecursiveDirectCallClassifier()

static std::unique_ptr<CallTypeClassifier> jlm::llvm::CallTypeClassifier::CreateNonRecursiveDirectCallClassifier ( rvsdg::Output output)
inlinestatic

Classify callee as non-recursive.

Parameters
outputOutput representing the function called (must be a lambda).
Precondition
The given output must belong to a lambda node.

Definition at line 191 of file call.hpp.

◆ CreateRecursiveDirectCallClassifier()

static std::unique_ptr<CallTypeClassifier> jlm::llvm::CallTypeClassifier::CreateRecursiveDirectCallClassifier ( rvsdg::Output output)
inlinestatic

Classify callee as recursive.

Parameters
outputOutput representing the function called (must be phi argument).
Precondition
The given output must belong to a phi node.

Definition at line 207 of file call.hpp.

◆ GetCallType()

CallType jlm::llvm::CallTypeClassifier::GetCallType ( ) const
inlinenoexcept

Return call type.

Definition at line 60 of file call.hpp.

◆ GetFunctionOrigin()

jlm::rvsdg::Output& jlm::llvm::CallTypeClassifier::GetFunctionOrigin ( ) const
inlinenoexcept

Return origin of a call node's function input.

GetFunctionOrigin() returns the last output returned by CallNode::TraceFunctionInput().

Returns
Traced origin of a call node's function input.
See also
CallNode::TraceFunctionInput(), CallNode::GetFunctionInput()

Definition at line 162 of file call.hpp.

◆ GetImport()

rvsdg::RegionArgument& jlm::llvm::CallTypeClassifier::GetImport ( ) const
inlinenoexcept

Returns the imported function.

GetImport() only returns a valid result if the call is an external call.

Returns
The imported function.

Definition at line 147 of file call.hpp.

◆ GetLambdaOutput()

rvsdg::Output& jlm::llvm::CallTypeClassifier::GetLambdaOutput ( ) const
inlinenoexcept

Returns the called function.

GetLambdaOutput() only returns a valid result if the call node is a (non-)recursive direct call.

Returns
The called function.

Definition at line 123 of file call.hpp.

◆ IsDirectCall()

bool jlm::llvm::CallTypeClassifier::IsDirectCall ( ) const
inlinenoexcept
Returns
True if call is a (non-)recursive direct call, otherwise false.

Definition at line 89 of file call.hpp.

◆ IsExternalCall()

bool jlm::llvm::CallTypeClassifier::IsExternalCall ( ) const
inlinenoexcept

Determines whether call is an external call.

Returns
True if call is an external call, otherwise false.

Definition at line 100 of file call.hpp.

◆ IsIndirectCall()

bool jlm::llvm::CallTypeClassifier::IsIndirectCall ( ) const
inlinenoexcept

Determines whether call is an indirect call.

Returns
True if call is an indirect call, otherwise false.

Definition at line 110 of file call.hpp.

◆ IsNonRecursiveDirectCall()

bool jlm::llvm::CallTypeClassifier::IsNonRecursiveDirectCall ( ) const
inlinenoexcept

Determines whether call is a non-recursive direct call.

Returns
True if call is a non-recursive direct call, otherwise false.

Definition at line 70 of file call.hpp.

◆ IsRecursiveDirectCall()

bool jlm::llvm::CallTypeClassifier::IsRecursiveDirectCall ( ) const
inlinenoexcept

Determines whether call is a recursive direct call.

Returns
True if call is a recursive direct call, otherwise false.

Definition at line 80 of file call.hpp.

◆ isSetjmpCall()

bool jlm::llvm::CallTypeClassifier::isSetjmpCall ( )

Calling setjmp has special semantics that affect the calling function.

Returns
true if the call is a direct call to the imported setjmp function, otherwise false

Definition at line 77 of file call.cpp.

◆ isVaStartCall()

bool jlm::llvm::CallTypeClassifier::isVaStartCall ( )

Calling the va_start intrinsic has special semantics that affect the calling function.

Returns
true if the call is a direct call to the va_start instrinsic, otherwise false

Definition at line 92 of file call.cpp.

Member Data Documentation

◆ CallType_

CallType jlm::llvm::CallTypeClassifier::CallType_
private

Definition at line 241 of file call.hpp.

◆ Output_

jlm::rvsdg::Output* jlm::llvm::CallTypeClassifier::Output_
private

Definition at line 242 of file call.hpp.


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