LLVM  14.0.0git
Functions
llvm::AttributeFuncs Namespace Reference

Functions

AttrBuilder typeIncompatible (Type *Ty)
 Which attributes cannot be applied to a type. More...
 
AttrBuilder getUBImplyingAttributes ()
 Get param/return attributes which imply immediate undefined behavior if an invalid value is passed. More...
 
bool areInlineCompatible (const Function &Caller, const Function &Callee)
 
bool areOutlineCompatible (const Function &A, const Function &B)
 Checks if there are any incompatible function attributes between A and B. More...
 
void mergeAttributesForInlining (Function &Caller, const Function &Callee)
 Merge caller's and callee's attributes. More...
 
void mergeAttributesForOutlining (Function &Base, const Function &ToMerge)
 Merges the functions attributes from ToMerge into function Base. More...
 

Function Documentation

◆ areInlineCompatible()

bool llvm::AttributeFuncs::areInlineCompatible ( const Function Caller,
const Function Callee 
)
Returns
Return true if the two functions have compatible target-independent attributes for inlining purposes.

Definition at line 2019 of file Attributes.cpp.

References Callee.

Referenced by functionsHaveCompatibleAttributes().

◆ areOutlineCompatible()

bool llvm::AttributeFuncs::areOutlineCompatible ( const Function A,
const Function B 
)

Checks if there are any incompatible function attributes between A and B.

Parameters
[in]A- The first function to be compared with.
[in]B- The second function to be compared with.
Returns
true if the functions have compatible attributes.

Definition at line 2024 of file Attributes.cpp.

References B.

◆ getUBImplyingAttributes()

AttrBuilder llvm::AttributeFuncs::getUBImplyingAttributes ( )

Get param/return attributes which imply immediate undefined behavior if an invalid value is passed.

For example, this includes noundef (where undef implies UB), but not nonnull (where null implies poison). It also does not include attributes like nocapture, which constrain the function implementation rather than the passed value.

Definition at line 1845 of file Attributes.cpp.

References B.

Referenced by llvm::Instruction::dropUndefImplyingAttrsAndUnknownMetadata().

◆ mergeAttributesForInlining()

void llvm::AttributeFuncs::mergeAttributesForInlining ( Function Caller,
const Function Callee 
)

Merge caller's and callee's attributes.

Definition at line 2029 of file Attributes.cpp.

References Callee.

Referenced by inlineCallIfPossible(), and llvm::AlwaysInlinerPass::run().

◆ mergeAttributesForOutlining()

void llvm::AttributeFuncs::mergeAttributesForOutlining ( Function Base,
const Function ToMerge 
)

Merges the functions attributes from ToMerge into function Base.

Parameters
[in,out]Base- The function being merged into.
[in]ToMerge- The function to merge attributes from.

Definition at line 2034 of file Attributes.cpp.

References llvm::sampleprof::Base.

◆ typeIncompatible()

AttrBuilder llvm::AttributeFuncs::typeIncompatible ( Type Ty)