DirectAttrInfo {
100 structIndirectAttrInfo {
110 boolPaddingInReg : 1;
111 boolInAllocaSRet : 1;
112 boolInAllocaIndirect : 1;
113 boolIndirectByVal : 1;
114 boolIndirectRealign : 1;
115 boolSRetAfterThis : 1;
117 boolCanBeFlattened: 1;
121 boolcanHavePaddingType()
const{
125 voidsetPaddingType(llvm::Type *
T) {
126assert(canHavePaddingType());
130 voidsetUnpaddedCoerceToType(llvm::Type *
T) {
139InAllocaIndirect(
false), IndirectByVal(
false), IndirectRealign(
false),
144llvm::Type *Padding =
nullptr,
145 boolCanBeFlattened =
true,
unsignedAlign = 0) {
147AI.setCoerceToType(
T);
148AI.setPaddingType(Padding);
149AI.setDirectOffset(Offset);
150AI.setDirectAlign(Align);
151AI.setCanBeFlattened(CanBeFlattened);
163AI.setCoerceToType(
T);
164AI.setPaddingType(
nullptr);
165AI.setDirectOffset(0);
166AI.setDirectAlign(0);
167AI.setSignExt(
true);
174AI.setCoerceToType(
T);
175AI.setPaddingType(
nullptr);
176AI.setDirectOffset(0);
177AI.setDirectAlign(0);
178AI.setZeroExt(
true);
194AI.setCoerceToType(
T);
195AI.setPaddingType(
nullptr);
196AI.setDirectOffset(0);
197AI.setDirectAlign(0);
210 boolRealign =
false,
211llvm::Type *Padding =
nullptr) {
213AI.setIndirectAlign(Alignment);
214AI.setIndirectByVal(ByVal);
215AI.setIndirectRealign(Realign);
216AI.setSRetAfterThis(
false);
217AI.setPaddingType(Padding);
223 boolRealign =
false,
224llvm::Type *Padding =
nullptr) {
226AI.setIndirectAlign(Alignment);
227AI.setIndirectRealign(Realign);
228AI.setPaddingType(Padding);
229AI.setIndirectAddrSpace(AddrSpace);
234 boolRealign =
false) {
241AI.setInAllocaFieldIndex(FieldIndex);
247AI.setPaddingType(
nullptr);
251llvm::Type *Padding) {
253AI.setPaddingInReg(PaddingInReg);
254AI.setPaddingType(Padding);
262llvm::Type *unpaddedCoerceToType) {
267 autounpaddedStruct = dyn_cast<llvm::StructType>(unpaddedCoerceToType);
268assert(!unpaddedStruct || unpaddedStruct->getNumElements() != 1);
272 unsignedunpaddedIndex = 0;
273 for(
autoeltType : coerceToType->elements()) {
280 if(unpaddedStruct) {
281assert(unpaddedStruct->getNumElements() == unpaddedIndex);
283assert(unpaddedIndex == 1);
288AI.setCoerceToType(coerceToType);
289AI.setUnpaddedCoerceToType(unpaddedCoerceToType);
294 returneltType->isArrayTy() &&
295eltType->getArrayElementType()->isIntegerTy(8);
332assert(
isExtend() && (SignExt + ZeroExt <= 1) &&
"Invalid kind / flags!");
336assert(
isExtend() &&
"Invalid kind!");
341assert(
isExtend() && (SignExt + ZeroExt <= 1) &&
"Invalid kind / flags!");
345assert(
isExtend() &&
"Invalid kind!");
350assert(
isExtend() && (SignExt + ZeroExt <= 1) &&
"Invalid kind / flags!");
351 return!SignExt && !ZeroExt;
355 return(canHavePaddingType() ?
PaddingType:
nullptr);
377 returncast<llvm::StructType>(TypeData);
389 returnstructTy->elements();
417 returnIndirectByVal;
436 returnIndirectRealign;
440IndirectRealign = IR;
445 returnSRetAfterThis;
449SRetAfterThis = AfterThis;
463 returnInAllocaIndirect;
483assert(
isDirect() &&
"Invalid kind!");
484 returnCanBeFlattened;
488assert(
isDirect() &&
"Invalid kind!");
489CanBeFlattened = Flatten;
500 unsignedNumRequired;
515 unsignedadditional) {
519additional += llvm::count_if(
522return ExtInfo.hasPassObjectSize();
529 unsignedadditional) {
549 returnargIdx == ~0
U|| argIdx < NumRequired;
554 if(value == ~0
U)
return All;
569:
publicllvm::FoldingSetNode,
570 privatellvm::TrailingObjects<CGFunctionInfo, CGFunctionInfoArgInfo,
571FunctionProtoType::ExtParameterInfo> {
577 unsignedCallingConvention : 8;
581 unsignedEffectiveCallingConvention : 8;
585 unsignedASTCallingConvention : 6;
588LLVM_PREFERRED_TYPE(
bool)
589 unsignedInstanceMethod : 1;
592LLVM_PREFERRED_TYPE(
bool)
593 unsignedChainCall : 1;
597LLVM_PREFERRED_TYPE(
bool)
598 unsignedDelegateCall : 1;
601LLVM_PREFERRED_TYPE(
bool)
602 unsignedCmseNSCall : 1;
605LLVM_PREFERRED_TYPE(
bool)
606 unsignedNoReturn : 1;
609LLVM_PREFERRED_TYPE(
bool)
610 unsignedReturnsRetained : 1;
613LLVM_PREFERRED_TYPE(
bool)
614 unsignedNoCallerSavedRegs : 1;
617LLVM_PREFERRED_TYPE(
bool)
618 unsignedHasRegParm : 1;
619 unsignedRegParm : 3;
622LLVM_PREFERRED_TYPE(
bool)
623 unsignedNoCfCheck : 1;
626 unsignedMaxVectorWidth : 4;
632llvm::StructType *ArgStruct;
633 unsignedArgStructAlign : 31;
634LLVM_PREFERRED_TYPE(
bool)
635 unsignedHasExtParameterInfos : 1;
640 returngetTrailingObjects<ArgInfo>();
642 const ArgInfo*getArgsBuffer()
const{
643 returngetTrailingObjects<ArgInfo>();
647 returngetTrailingObjects<ExtParameterInfo>();
650 returngetTrailingObjects<ExtParameterInfo>();
657 create(
unsignedllvmCC,
boolinstanceMethod,
boolchainCall,
661 void operator delete(
void*p) { ::operator
delete(p); }
670 return(HasExtParameterInfos ? NumArgs : 0);
729 returnEffectiveCallingConvention;
732EffectiveCallingConvention =
Value;
751 if(!HasExtParameterInfos)
return{};
755assert(argIndex <= NumArgs);
775 returnMaxVectorWidth ? 1U << (MaxVectorWidth - 1) : 0;
780assert(llvm::isPowerOf2_32(Width) &&
"Expected power of 2 vector");
781MaxVectorWidth = llvm::countr_zero(Width) + 1;
786 ID.AddBoolean(InstanceMethod);
787 ID.AddBoolean(ChainCall);
788 ID.AddBoolean(DelegateCall);
789 ID.AddBoolean(NoReturn);
790 ID.AddBoolean(ReturnsRetained);
791 ID.AddBoolean(NoCallerSavedRegs);
792 ID.AddBoolean(HasRegParm);
793 ID.AddInteger(RegParm);
794 ID.AddBoolean(NoCfCheck);
795 ID.AddBoolean(CmseNSCall);
797 ID.AddBoolean(HasExtParameterInfos);
798 if(HasExtParameterInfos) {
800 ID.AddInteger(paramInfo.getOpaqueValue());
804I.type.Profile(
ID);
806 static void Profile(llvm::FoldingSetNodeID &
ID,
boolInstanceMethod,
812 ID.AddInteger(info.
getCC());
813 ID.AddBoolean(InstanceMethod);
814 ID.AddBoolean(ChainCall);
824 ID.AddBoolean(!paramInfos.empty());
825 if(!paramInfos.empty()) {
826 for(
autoparamInfo : paramInfos)
827 ID.AddInteger(paramInfo.getOpaqueValue());
831i = argTypes.begin(), e = argTypes.end(); i != e; ++i) {
C Language Family Type Representation.
Represents a canonical, potentially-qualified type.
void Profile(llvm::FoldingSetNodeID &ID) const
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
CharUnits - This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
void setZeroExt(bool ZExt)
unsigned getInAllocaFieldIndex() const
void setIndirectAddrSpace(unsigned AddrSpace)
static ABIArgInfo getNoExtend(llvm::IntegerType *T)
bool getIndirectByVal() const
llvm::StructType * getCoerceAndExpandType() const
bool getIndirectRealign() const
static ABIArgInfo getInAlloca(unsigned FieldIndex, bool Indirect=false)
static ABIArgInfo getIgnore()
static ABIArgInfo getExpand()
void setCoerceToType(llvm::Type *T)
llvm::Type * getUnpaddedCoerceAndExpandType() const
bool getCanBeFlattened() const
unsigned getDirectOffset() const
static bool isPaddingForCoerceAndExpand(llvm::Type *eltType)
void setDirectOffset(unsigned Offset)
void setPaddingInReg(bool PIR)
bool getInAllocaSRet() const
Return true if this field of an inalloca struct should be returned to implement a struct return calli...
void setIndirectAlign(CharUnits IA)
llvm::Type * getPaddingType() const
void setIndirectByVal(bool IBV)
static ABIArgInfo getExtendInReg(QualType Ty, llvm::Type *T=nullptr)
bool getPaddingInReg() const
static ABIArgInfo getExpandWithPadding(bool PaddingInReg, llvm::Type *Padding)
unsigned getDirectAlign() const
unsigned getIndirectAddrSpace() const
ABIArgInfo(Kind K=Direct)
static ABIArgInfo getIndirectInReg(CharUnits Alignment, bool ByVal=true, bool Realign=false)
static ABIArgInfo getIndirect(CharUnits Alignment, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
void setIndirectRealign(bool IR)
static ABIArgInfo getDirect(llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0)
@ Extend
Extend - Valid only for integer argument types.
@ Ignore
Ignore - Ignore the argument (treat as void).
@ IndirectAliased
IndirectAliased - Similar to Indirect, but the pointer may be to an object that is otherwise referenc...
@ Expand
Expand - Only valid for aggregate argument types.
@ InAlloca
InAlloca - Pass the argument directly using the LLVM inalloca attribute.
@ Indirect
Indirect - Pass the argument indirectly via a hidden pointer with the specified alignment (0 indicate...
@ CoerceAndExpand
CoerceAndExpand - Only valid for aggregate argument types.
@ Direct
Direct - Pass the argument directly using the normal converted LLVM type, or by coercing to another s...
ArrayRef< llvm::Type * > getCoerceAndExpandTypeSequence() const
static ABIArgInfo getIndirectAliased(CharUnits Alignment, unsigned AddrSpace, bool Realign=false, llvm::Type *Padding=nullptr)
Pass this in memory using the IR byref attribute.
void setSRetAfterThis(bool AfterThis)
void setInAllocaIndirect(bool Indirect)
void setInAllocaSRet(bool SRet)
bool isCoerceAndExpand() const
static ABIArgInfo getZeroExtend(QualType Ty, llvm::Type *T=nullptr)
static ABIArgInfo getExtend(QualType Ty, llvm::Type *T=nullptr)
DirectAttrInfo DirectAttr
static ABIArgInfo getCoerceAndExpand(llvm::StructType *coerceToType, llvm::Type *unpaddedCoerceToType)
unsigned AllocaFieldIndex
unsigned getInAllocaIndirect() const
llvm::Type * getCoerceToType() const
bool isIndirectAliased() const
void setInAllocaFieldIndex(unsigned FieldIndex)
bool isSRetAfterThis() const
IndirectAttrInfo IndirectAttr
bool canHaveCoerceToType() const
llvm::Type * UnpaddedCoerceAndExpandType
void setSignExt(bool SExt)
void setCanBeFlattened(bool Flatten)
void setDirectAlign(unsigned Align)
static ABIArgInfo getSignExtend(QualType Ty, llvm::Type *T=nullptr)
CharUnits getIndirectAlign() const
static ABIArgInfo getDirectInReg(llvm::Type *T=nullptr)
CGFunctionInfo - Class to encapsulate the information about a function definition.
bool usesInAlloca() const
Return true if this function uses inalloca arguments.
FunctionType::ExtInfo getExtInfo() const
bool isInstanceMethod() const
ABIArgInfo & getReturnInfo()
bool isReturnsRetained() const
In ARC, whether this function retains its return value.
unsigned getCallingConvention() const
getCallingConvention - Return the user specified calling convention, which has been translated into a...
void Profile(llvm::FoldingSetNodeID &ID)
const_arg_iterator arg_begin() const
bool isNoCallerSavedRegs() const
Whether this function no longer saves caller registers.
unsigned getRegParm() const
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
CanQualType getReturnType() const
bool isNoCfCheck() const
Whether this function has nocf_check attribute.
CallingConv getASTCallingConvention() const
getASTCallingConvention() - Return the AST-specified calling convention.
const ABIArgInfo & getReturnInfo() const
bool getHasRegParm() const
ArrayRef< ArgInfo > arguments() const
const ArgInfo * const_arg_iterator
static CGFunctionInfo * create(unsigned llvmCC, bool instanceMethod, bool chainCall, bool delegateCall, const FunctionType::ExtInfo &extInfo, ArrayRef< ExtParameterInfo > paramInfos, CanQualType resultType, ArrayRef< CanQualType > argTypes, RequiredArgs required)
static void Profile(llvm::FoldingSetNodeID &ID, bool InstanceMethod, bool ChainCall, bool IsDelegateCall, const FunctionType::ExtInfo &info, ArrayRef< ExtParameterInfo > paramInfos, RequiredArgs required, CanQualType resultType, ArrayRef< CanQualType > argTypes)
friend class TrailingObjects
bool isCmseNSCall() const
bool isDelegateCall() const
MutableArrayRef< ArgInfo > arguments()
const_arg_iterator arg_end() const
unsigned getEffectiveCallingConvention() const
getEffectiveCallingConvention - Return the actual calling convention to use, which may depend on the ...
void setArgStruct(llvm::StructType *Ty, CharUnits Align)
size_t numTrailingObjects(OverloadToken< ArgInfo >) const
ExtParameterInfo getExtParameterInfo(unsigned argIndex) const
unsigned getMaxVectorWidth() const
Return the maximum vector width in the arguments.
CharUnits getArgStructAlignment() const
size_t numTrailingObjects(OverloadToken< ExtParameterInfo >) const
unsigned arg_size() const
RequiredArgs getRequiredArgs() const
void setEffectiveCallingConvention(unsigned Value)
unsigned getNumRequiredArgs() const
llvm::StructType * getArgStruct() const
Get the struct type used to represent all the arguments in memory.
void setMaxVectorWidth(unsigned Width)
Set the maximum vector width in the arguments.
A class for recording the number of arguments that a function signature requires.
static RequiredArgs forPrototypePlus(CanQual< FunctionProtoType > prototype, unsigned additional)
bool allowsOptionalArgs() const
unsigned getNumRequiredArgs() const
static RequiredArgs forPrototype(CanQual< FunctionProtoType > prototype)
static RequiredArgs forPrototypePlus(const FunctionProtoType *prototype, unsigned additional)
Compute the arguments required by the given formal prototype, given that there may be some additional...
static RequiredArgs getFromOpaqueData(unsigned value)
bool isRequiredArg(unsigned argIdx) const
Return true if the argument at a given index is required.
static RequiredArgs forPrototype(const FunctionProtoType *prototype)
unsigned getOpaqueData() const
Represents a prototype with parameter type info, e.g.
unsigned getNumParams() const
bool isVariadic() const
Whether this function prototype is variadic.
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
bool hasExtParameterInfos() const
Is there any interesting extra information for any of the parameters of this function type?
A class which abstracts out some details necessary for making a call.
CallingConv getCC() const
bool getCmseNSCall() const
bool getNoCfCheck() const
unsigned getRegParm() const
bool getNoCallerSavedRegs() const
bool getHasRegParm() const
bool getProducesResult() const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
A (possibly-)qualified type.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g....
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
CallingConv
CallingConv - Specifies the calling convention that a function uses.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4