Lines Matching refs:Attribute

92 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind,  in get()
94 bool IsIntAttr = Attribute::isIntAttrKind(Kind); in get()
95 assert((IsIntAttr || Attribute::isEnumAttrKind(Kind)) && in get()
120 return Attribute(PA); in get()
123 Attribute Attribute::get(LLVMContext &Context, StringRef Kind, StringRef Val) { in get()
143 return Attribute(PA); in get()
146 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
148 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in get()
165 return Attribute(PA); in get()
168 Attribute Attribute::getWithAlignment(LLVMContext &Context, Align A) { in getWithAlignment()
173 Attribute Attribute::getWithStackAlignment(LLVMContext &Context, Align A) { in getWithStackAlignment()
178 Attribute Attribute::getWithDereferenceableBytes(LLVMContext &Context, in getWithDereferenceableBytes()
184 Attribute Attribute::getWithDereferenceableOrNullBytes(LLVMContext &Context, in getWithDereferenceableOrNullBytes()
190 Attribute Attribute::getWithByValType(LLVMContext &Context, Type *Ty) { in getWithByValType()
194 Attribute Attribute::getWithStructRetType(LLVMContext &Context, Type *Ty) { in getWithStructRetType()
198 Attribute Attribute::getWithByRefType(LLVMContext &Context, Type *Ty) { in getWithByRefType()
202 Attribute Attribute::getWithPreallocatedType(LLVMContext &Context, Type *Ty) { in getWithPreallocatedType()
206 Attribute Attribute::getWithInAllocaType(LLVMContext &Context, Type *Ty) { in getWithInAllocaType()
210 Attribute Attribute::getWithUWTableKind(LLVMContext &Context, in getWithUWTableKind()
215 Attribute Attribute::getWithMemoryEffects(LLVMContext &Context, in getWithMemoryEffects()
220 Attribute Attribute::getWithNoFPClass(LLVMContext &Context, in getWithNoFPClass()
225 Attribute
226 Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg, in getWithAllocSizeArgs()
233 Attribute Attribute::getWithVScaleRangeArgs(LLVMContext &Context, in getWithVScaleRangeArgs()
239 Attribute::AttrKind Attribute::getAttrKindFromName(StringRef AttrName) { in getAttrKindFromName()
240 return StringSwitch<Attribute::AttrKind>(AttrName) in getAttrKindFromName()
243 .Case(#DISPLAY_NAME, Attribute::ENUM_NAME) in getAttrKindFromName()
245 .Default(Attribute::None); in getAttrKindFromName()
248 StringRef Attribute::getNameFromAttrKind(Attribute::AttrKind AttrKind) { in getNameFromAttrKind()
252 case Attribute::ENUM_NAME: \ in getNameFromAttrKind()
255 case Attribute::None: in getNameFromAttrKind()
262 bool Attribute::isExistingAttribute(StringRef Name) { in isExistingAttribute()
274 bool Attribute::isEnumAttribute() const { in isEnumAttribute()
278 bool Attribute::isIntAttribute() const { in isIntAttribute()
282 bool Attribute::isStringAttribute() const { in isStringAttribute()
286 bool Attribute::isTypeAttribute() const { in isTypeAttribute()
290 Attribute::AttrKind Attribute::getKindAsEnum() const { in getKindAsEnum()
297 uint64_t Attribute::getValueAsInt() const { in getValueAsInt()
304 bool Attribute::getValueAsBool() const { in getValueAsBool()
311 StringRef Attribute::getKindAsString() const { in getKindAsString()
318 StringRef Attribute::getValueAsString() const { in getValueAsString()
325 Type *Attribute::getValueAsType() const { in getValueAsType()
333 bool Attribute::hasAttribute(AttrKind Kind) const { in hasAttribute()
337 bool Attribute::hasAttribute(StringRef Kind) const { in hasAttribute()
342 MaybeAlign Attribute::getAlignment() const { in getAlignment()
343 assert(hasAttribute(Attribute::Alignment) && in getAlignment()
348 MaybeAlign Attribute::getStackAlignment() const { in getStackAlignment()
349 assert(hasAttribute(Attribute::StackAlignment) && in getStackAlignment()
354 uint64_t Attribute::getDereferenceableBytes() const { in getDereferenceableBytes()
355 assert(hasAttribute(Attribute::Dereferenceable) && in getDereferenceableBytes()
361 uint64_t Attribute::getDereferenceableOrNullBytes() const { in getDereferenceableOrNullBytes()
362 assert(hasAttribute(Attribute::DereferenceableOrNull) && in getDereferenceableOrNullBytes()
369 Attribute::getAllocSizeArgs() const { in getAllocSizeArgs()
370 assert(hasAttribute(Attribute::AllocSize) && in getAllocSizeArgs()
375 unsigned Attribute::getVScaleRangeMin() const { in getVScaleRangeMin()
376 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeMin()
381 std::optional<unsigned> Attribute::getVScaleRangeMax() const { in getVScaleRangeMax()
382 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeMax()
387 UWTableKind Attribute::getUWTableKind() const { in getUWTableKind()
388 assert(hasAttribute(Attribute::UWTable) && in getUWTableKind()
393 AllocFnKind Attribute::getAllocKind() const { in getAllocKind()
394 assert(hasAttribute(Attribute::AllocKind) && in getAllocKind()
399 MemoryEffects Attribute::getMemoryEffects() const { in getMemoryEffects()
400 assert(hasAttribute(Attribute::Memory) && in getMemoryEffects()
405 FPClassTest Attribute::getNoFPClass() const { in getNoFPClass()
406 assert(hasAttribute(Attribute::NoFPClass) && in getNoFPClass()
425 std::string Attribute::getAsString(bool InAttrGrp) const { in getAsString()
446 if (hasAttribute(Attribute::Alignment)) in getAsString()
457 if (hasAttribute(Attribute::StackAlignment)) in getAsString()
460 if (hasAttribute(Attribute::Dereferenceable)) in getAsString()
463 if (hasAttribute(Attribute::DereferenceableOrNull)) in getAsString()
466 if (hasAttribute(Attribute::AllocSize)) { in getAsString()
477 if (hasAttribute(Attribute::VScaleRange)) { in getAsString()
485 if (hasAttribute(Attribute::UWTable)) { in getAsString()
496 if (hasAttribute(Attribute::AllocKind)) { in getAsString()
516 if (hasAttribute(Attribute::Memory)) { in getAsString()
558 if (hasAttribute(Attribute::NoFPClass)) { in getAsString()
592 bool Attribute::hasParentContext(LLVMContext &C) const { in hasParentContext()
600 bool Attribute::operator<(Attribute A) const { in operator <()
607 void Attribute::Profile(FoldingSetNodeID &ID) const { in Profile()
620 static bool hasAttributeProperty(Attribute::AttrKind Kind, in hasAttributeProperty()
627 bool Attribute::canUseAsFnAttr(AttrKind Kind) { in canUseAsFnAttr()
631 bool Attribute::canUseAsParamAttr(AttrKind Kind) { in canUseAsParamAttr()
635 bool Attribute::canUseAsRetAttr(AttrKind Kind) { in canUseAsRetAttr()
643 bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { in hasAttribute()
653 Attribute::AttrKind AttributeImpl::getKindAsEnum() const { in getKindAsEnum()
716 AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<Attribute> Attrs) { in get()
721 Attribute::AttrKind Kind) const { in addAttribute()
749 Attribute::AttrKind Kind) const { in removeAttribute()
779 bool AttributeSet::hasAttribute(Attribute::AttrKind Kind) const { in hasAttribute()
787 Attribute AttributeSet::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
788 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
791 Attribute AttributeSet::getAttribute(StringRef Kind) const { in getAttribute()
792 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
812 return SetNode ? SetNode->getAttributeType(Attribute::ByRef) : nullptr; in getByRefType()
816 return SetNode ? SetNode->getAttributeType(Attribute::ByVal) : nullptr; in getByValType()
820 return SetNode ? SetNode->getAttributeType(Attribute::StructRet) : nullptr; in getStructRetType()
824 return SetNode ? SetNode->getAttributeType(Attribute::Preallocated) : nullptr; in getPreallocatedType()
828 return SetNode ? SetNode->getAttributeType(Attribute::InAlloca) : nullptr; in getInAllocaType()
832 return SetNode ? SetNode->getAttributeType(Attribute::ElementType) : nullptr; in getElementType()
898 AttributeSetNode::AttributeSetNode(ArrayRef<Attribute> Attrs) in AttributeSetNode()
901 llvm::copy(Attrs, getTrailingObjects<Attribute>()); in AttributeSetNode()
912 ArrayRef<Attribute> Attrs) { in get()
913 SmallVector<Attribute, 8> SortedAttrs(Attrs.begin(), Attrs.end()); in get()
919 ArrayRef<Attribute> SortedAttrs) { in getSorted()
939 void *Mem = ::operator new(totalSizeToAlloc<Attribute>(SortedAttrs.size())); in getSorted()
956 std::optional<Attribute>
957 AttributeSetNode::findEnumAttribute(Attribute::AttrKind Kind) const { in findEnumAttribute()
964 const Attribute *I = in findEnumAttribute()
966 [](Attribute A, Attribute::AttrKind Kind) { in findEnumAttribute()
973 Attribute AttributeSetNode::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
979 Attribute AttributeSetNode::getAttribute(StringRef Kind) const { in getAttribute()
984 if (auto A = findEnumAttribute(Attribute::Alignment)) in getAlignment()
990 if (auto A = findEnumAttribute(Attribute::StackAlignment)) in getStackAlignment()
995 Type *AttributeSetNode::getAttributeType(Attribute::AttrKind Kind) const { in getAttributeType()
1002 if (auto A = findEnumAttribute(Attribute::Dereferenceable)) in getDereferenceableBytes()
1008 if (auto A = findEnumAttribute(Attribute::DereferenceableOrNull)) in getDereferenceableOrNullBytes()
1015 if (auto A = findEnumAttribute(Attribute::AllocSize)) in getAllocSizeArgs()
1021 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeMin()
1027 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeMax()
1033 if (auto A = findEnumAttribute(Attribute::UWTable)) in getUWTableKind()
1039 if (auto A = findEnumAttribute(Attribute::AllocKind)) in getAllocKind()
1045 if (auto A = findEnumAttribute(Attribute::Memory)) in getMemoryEffects()
1051 if (auto A = findEnumAttribute(Attribute::NoFPClass)) in getNoFPClass()
1105 bool AttributeListImpl::hasAttrSomewhere(Attribute::AttrKind Kind, in hasAttrSomewhere()
1162 ArrayRef<std::pair<unsigned, Attribute>> Attrs) { in get()
1170 [](const std::pair<unsigned, Attribute> &Pair) { in get()
1178 for (ArrayRef<std::pair<unsigned, Attribute>>::iterator I = Attrs.begin(), in get()
1181 SmallVector<Attribute, 4> AttrVec; in get()
1278 ArrayRef<Attribute::AttrKind> Kinds) { in get()
1279 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1281 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1286 ArrayRef<Attribute::AttrKind> Kinds, in get()
1289 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1292 Attrs.emplace_back(Index, Attribute::get(C, K, *VI++)); in get()
1298 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1300 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1332 Attribute::AttrKind Kind) const { in addAttributeAtIndex()
1337 SmallVector<Attribute, 8> NewAttrs(Attrs.begin(), Attrs.end()); in addAttributeAtIndex()
1338 NewAttrs.push_back(Attribute::get(C, Kind)); in addAttributeAtIndex()
1351 Attribute A) const { in addAttributeAtIndex()
1390 Attribute A) const { in addParamAttribute()
1410 Attribute::AttrKind Kind) const { in removeAttributeAtIndex()
1496 Attribute::AttrKind Kind) const { in hasAttributeAtIndex()
1508 bool AttributeList::hasFnAttr(Attribute::AttrKind Kind) const { in hasFnAttr()
1516 bool AttributeList::hasAttrSomewhere(Attribute::AttrKind Attr, in hasAttrSomewhere()
1521 Attribute AttributeList::getAttributeAtIndex(unsigned Index, in getAttributeAtIndex()
1522 Attribute::AttrKind Kind) const { in getAttributeAtIndex()
1526 Attribute AttributeList::getAttributeAtIndex(unsigned Index, in getAttributeAtIndex()
1688 bool operator()(Attribute A0, Attribute A1) const { in operator ()()
1701 bool operator()(Attribute A0, Attribute::AttrKind Kind) const { in operator ()()
1706 bool operator()(Attribute A0, StringRef Kind) const { in operator ()()
1714 static void addAttributeImpl(SmallVectorImpl<Attribute> &Attrs, K Kind, in addAttributeImpl()
1715 Attribute Attr) { in addAttributeImpl()
1723 AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { in addAttribute()
1731 AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrKind Kind) { in addAttribute()
1732 addAttributeImpl(Attrs, Kind, Attribute::get(Ctx, Kind)); in addAttribute()
1737 addAttributeImpl(Attrs, A, Attribute::get(Ctx, A, V)); in addAttribute()
1741 AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) { in removeAttribute()
1742 assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!"); in removeAttribute()
1757 AttrBuilder::getRawIntAttr(Attribute::AttrKind Kind) const { in getRawIntAttr()
1758 assert(Attribute::isIntAttrKind(Kind) && "Not an int attribute"); in getRawIntAttr()
1759 Attribute A = getAttribute(Kind); in getRawIntAttr()
1765 AttrBuilder &AttrBuilder::addRawIntAttr(Attribute::AttrKind Kind, in addRawIntAttr()
1767 return addAttribute(Attribute::get(Ctx, Kind, Value)); in addRawIntAttr()
1772 Attribute A = getAttribute(Attribute::AllocSize); in getAllocSizeArgs()
1783 return addRawIntAttr(Attribute::Alignment, Align->value()); in addAlignmentAttr()
1792 return addRawIntAttr(Attribute::StackAlignment, Align->value()); in addStackAlignmentAttr()
1798 return addRawIntAttr(Attribute::Dereferenceable, Bytes); in addDereferenceableAttr()
1805 return addRawIntAttr(Attribute::DereferenceableOrNull, Bytes); in addDereferenceableOrNullAttr()
1817 return addRawIntAttr(Attribute::AllocSize, RawArgs); in addAllocSizeAttrFromRawRepr()
1830 return addRawIntAttr(Attribute::VScaleRange, RawArgs); in addVScaleRangeAttrFromRawRepr()
1836 return addRawIntAttr(Attribute::UWTable, uint64_t(Kind)); in addUWTableAttr()
1840 return addRawIntAttr(Attribute::Memory, ME.toIntValue()); in addMemoryAttr()
1847 return addRawIntAttr(Attribute::NoFPClass, Mask); in addNoFPClassAttr()
1851 return addRawIntAttr(Attribute::AllocKind, static_cast<uint64_t>(Kind)); in addAllocKindAttr()
1854 Type *AttrBuilder::getTypeAttr(Attribute::AttrKind Kind) const { in getTypeAttr()
1855 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in getTypeAttr()
1856 Attribute A = getAttribute(Kind); in getTypeAttr()
1860 AttrBuilder &AttrBuilder::addTypeAttr(Attribute::AttrKind Kind, Type *Ty) { in addTypeAttr()
1861 return addAttribute(Attribute::get(Ctx, Kind, Ty)); in addTypeAttr()
1865 return addTypeAttr(Attribute::ByVal, Ty); in addByValAttr()
1869 return addTypeAttr(Attribute::StructRet, Ty); in addStructRetAttr()
1873 return addTypeAttr(Attribute::ByRef, Ty); in addByRefAttr()
1877 return addTypeAttr(Attribute::Preallocated, Ty); in addPreallocatedAttr()
1881 return addTypeAttr(Attribute::InAlloca, Ty); in addInAllocaAttr()
1893 erase_if(Attrs, [&](Attribute A) { return AM.contains(A); }); in remove()
1898 return any_of(Attrs, [&](Attribute A) { return AM.contains(A); }); in overlaps()
1901 Attribute AttrBuilder::getAttribute(Attribute::AttrKind A) const { in getAttribute()
1902 assert((unsigned)A < Attribute::EndAttrKinds && "Attribute out of range!"); in getAttribute()
1909 Attribute AttrBuilder::getAttribute(StringRef A) const { in getAttribute()
1916 bool AttrBuilder::contains(Attribute::AttrKind A) const { in contains()
1950 Incompatible.addAttribute(Attribute::AllocAlign); in typeIncompatible()
1952 Incompatible.addAttribute(Attribute::SExt).addAttribute(Attribute::ZExt); in typeIncompatible()
1958 Incompatible.addAttribute(Attribute::NoAlias) in typeIncompatible()
1959 .addAttribute(Attribute::NoCapture) in typeIncompatible()
1960 .addAttribute(Attribute::NonNull) in typeIncompatible()
1961 .addAttribute(Attribute::ReadNone) in typeIncompatible()
1962 .addAttribute(Attribute::ReadOnly) in typeIncompatible()
1963 .addAttribute(Attribute::Dereferenceable) in typeIncompatible()
1964 .addAttribute(Attribute::DereferenceableOrNull) in typeIncompatible()
1965 .addAttribute(Attribute::Writable) in typeIncompatible()
1966 .addAttribute(Attribute::DeadOnUnwind); in typeIncompatible()
1968 Incompatible.addAttribute(Attribute::Nest) in typeIncompatible()
1969 .addAttribute(Attribute::SwiftError) in typeIncompatible()
1970 .addAttribute(Attribute::Preallocated) in typeIncompatible()
1971 .addAttribute(Attribute::InAlloca) in typeIncompatible()
1972 .addAttribute(Attribute::ByVal) in typeIncompatible()
1973 .addAttribute(Attribute::StructRet) in typeIncompatible()
1974 .addAttribute(Attribute::ByRef) in typeIncompatible()
1975 .addAttribute(Attribute::ElementType) in typeIncompatible()
1976 .addAttribute(Attribute::AllocatedPointer); in typeIncompatible()
1982 Incompatible.addAttribute(Attribute::Alignment); in typeIncompatible()
1987 Incompatible.addAttribute(Attribute::NoFPClass); in typeIncompatible()
1993 Incompatible.addAttribute(Attribute::NoUndef); in typeIncompatible()
2001 AM.addAttribute(Attribute::NoUndef); in getUBImplyingAttributes()
2002 AM.addAttribute(Attribute::Dereferenceable); in getUBImplyingAttributes()
2003 AM.addAttribute(Attribute::DereferenceableOrNull); in getUBImplyingAttributes()
2090 OldSSPAttr.addAttribute(Attribute::StackProtect) in adjustCallerSSPLevel()
2091 .addAttribute(Attribute::StackProtectStrong) in adjustCallerSSPLevel()
2092 .addAttribute(Attribute::StackProtectReq); in adjustCallerSSPLevel()
2094 if (Callee.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
2096 Caller.addFnAttr(Attribute::StackProtectReq); in adjustCallerSSPLevel()
2097 } else if (Callee.hasFnAttribute(Attribute::StackProtectStrong) && in adjustCallerSSPLevel()
2098 !Caller.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
2100 Caller.addFnAttr(Attribute::StackProtectStrong); in adjustCallerSSPLevel()
2101 } else if (Callee.hasFnAttribute(Attribute::StackProtect) && in adjustCallerSSPLevel()
2102 !Caller.hasFnAttribute(Attribute::StackProtectReq) && in adjustCallerSSPLevel()
2103 !Caller.hasFnAttribute(Attribute::StackProtectStrong)) in adjustCallerSSPLevel()
2104 Caller.addFnAttr(Attribute::StackProtect); in adjustCallerSSPLevel()
2121 Attribute CalleeAttr = Callee.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
2123 Attribute CallerAttr = Caller.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
2149 Attribute CallerAttr = Caller.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
2151 Attribute CalleeAttr = Callee.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
2171 Caller.addFnAttr(Attribute::NullPointerIsValid); in adjustNullPointerValidAttr()
2177 Attribute::AttrKind Kind) { in isSet()
2182 Attribute::AttrKind Kind, bool Val) { in set()
2206 static enum Attribute::AttrKind getKind() { \
2207 return llvm::Attribute::ENUM_NAME; \
2249 Attribute Attr = Fn.getFnAttribute("min-legal-vector-width"); in updateMinLegalVectorWidthAttr()