Lines Matching refs:Attribute

90 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind,  in get()
93 assert(Attribute::isIntAttrKind(Kind) && "Not an int attribute"); in get()
95 assert(Attribute::isEnumAttrKind(Kind) && "Not an enum attribute"); in get()
116 return Attribute(PA); in get()
119 Attribute Attribute::get(LLVMContext &Context, StringRef Kind, StringRef Val) { in get()
139 return Attribute(PA); in get()
142 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
144 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in get()
161 return Attribute(PA); in get()
164 Attribute Attribute::getWithAlignment(LLVMContext &Context, Align A) { in getWithAlignment()
169 Attribute Attribute::getWithStackAlignment(LLVMContext &Context, Align A) { in getWithStackAlignment()
174 Attribute Attribute::getWithDereferenceableBytes(LLVMContext &Context, in getWithDereferenceableBytes()
180 Attribute Attribute::getWithDereferenceableOrNullBytes(LLVMContext &Context, in getWithDereferenceableOrNullBytes()
186 Attribute Attribute::getWithByValType(LLVMContext &Context, Type *Ty) { in getWithByValType()
190 Attribute Attribute::getWithStructRetType(LLVMContext &Context, Type *Ty) { in getWithStructRetType()
194 Attribute Attribute::getWithByRefType(LLVMContext &Context, Type *Ty) { in getWithByRefType()
198 Attribute Attribute::getWithPreallocatedType(LLVMContext &Context, Type *Ty) { in getWithPreallocatedType()
202 Attribute Attribute::getWithInAllocaType(LLVMContext &Context, Type *Ty) { in getWithInAllocaType()
206 Attribute Attribute::getWithUWTableKind(LLVMContext &Context, in getWithUWTableKind()
211 Attribute
212 Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg, in getWithAllocSizeArgs()
219 Attribute Attribute::getWithVScaleRangeArgs(LLVMContext &Context, in getWithVScaleRangeArgs()
225 Attribute::AttrKind Attribute::getAttrKindFromName(StringRef AttrName) { in getAttrKindFromName()
226 return StringSwitch<Attribute::AttrKind>(AttrName) in getAttrKindFromName()
229 .Case(#DISPLAY_NAME, Attribute::ENUM_NAME) in getAttrKindFromName()
231 .Default(Attribute::None); in getAttrKindFromName()
234 StringRef Attribute::getNameFromAttrKind(Attribute::AttrKind AttrKind) { in getNameFromAttrKind()
238 case Attribute::ENUM_NAME: \ in getNameFromAttrKind()
241 case Attribute::None: in getNameFromAttrKind()
248 bool Attribute::isExistingAttribute(StringRef Name) { in isExistingAttribute()
260 bool Attribute::isEnumAttribute() const { in isEnumAttribute()
264 bool Attribute::isIntAttribute() const { in isIntAttribute()
268 bool Attribute::isStringAttribute() const { in isStringAttribute()
272 bool Attribute::isTypeAttribute() const { in isTypeAttribute()
276 Attribute::AttrKind Attribute::getKindAsEnum() const { in getKindAsEnum()
283 uint64_t Attribute::getValueAsInt() const { in getValueAsInt()
290 bool Attribute::getValueAsBool() const { in getValueAsBool()
297 StringRef Attribute::getKindAsString() const { in getKindAsString()
304 StringRef Attribute::getValueAsString() const { in getValueAsString()
311 Type *Attribute::getValueAsType() const { in getValueAsType()
319 bool Attribute::hasAttribute(AttrKind Kind) const { in hasAttribute()
323 bool Attribute::hasAttribute(StringRef Kind) const { in hasAttribute()
328 MaybeAlign Attribute::getAlignment() const { in getAlignment()
329 assert(hasAttribute(Attribute::Alignment) && in getAlignment()
334 MaybeAlign Attribute::getStackAlignment() const { in getStackAlignment()
335 assert(hasAttribute(Attribute::StackAlignment) && in getStackAlignment()
340 uint64_t Attribute::getDereferenceableBytes() const { in getDereferenceableBytes()
341 assert(hasAttribute(Attribute::Dereferenceable) && in getDereferenceableBytes()
347 uint64_t Attribute::getDereferenceableOrNullBytes() const { in getDereferenceableOrNullBytes()
348 assert(hasAttribute(Attribute::DereferenceableOrNull) && in getDereferenceableOrNullBytes()
354 std::pair<unsigned, Optional<unsigned>> Attribute::getAllocSizeArgs() const { in getAllocSizeArgs()
355 assert(hasAttribute(Attribute::AllocSize) && in getAllocSizeArgs()
360 unsigned Attribute::getVScaleRangeMin() const { in getVScaleRangeMin()
361 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeMin()
366 Optional<unsigned> Attribute::getVScaleRangeMax() const { in getVScaleRangeMax()
367 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeMax()
372 UWTableKind Attribute::getUWTableKind() const { in getUWTableKind()
373 assert(hasAttribute(Attribute::UWTable) && in getUWTableKind()
378 AllocFnKind Attribute::getAllocKind() const { in getAllocKind()
379 assert(hasAttribute(Attribute::AllocKind) && in getAllocKind()
384 std::string Attribute::getAsString(bool InAttrGrp) const { in getAsString()
405 if (hasAttribute(Attribute::Alignment)) in getAsString()
416 if (hasAttribute(Attribute::StackAlignment)) in getAsString()
419 if (hasAttribute(Attribute::Dereferenceable)) in getAsString()
422 if (hasAttribute(Attribute::DereferenceableOrNull)) in getAsString()
425 if (hasAttribute(Attribute::AllocSize)) { in getAsString()
436 if (hasAttribute(Attribute::VScaleRange)) { in getAsString()
444 if (hasAttribute(Attribute::UWTable)) { in getAsString()
455 if (hasAttribute(Attribute::AllocKind)) { in getAsString()
502 bool Attribute::hasParentContext(LLVMContext &C) const { in hasParentContext()
510 bool Attribute::operator<(Attribute A) const { in operator <()
517 void Attribute::Profile(FoldingSetNodeID &ID) const { in Profile()
530 static bool hasAttributeProperty(Attribute::AttrKind Kind, in hasAttributeProperty()
538 bool Attribute::canUseAsFnAttr(AttrKind Kind) { in canUseAsFnAttr()
542 bool Attribute::canUseAsParamAttr(AttrKind Kind) { in canUseAsParamAttr()
546 bool Attribute::canUseAsRetAttr(AttrKind Kind) { in canUseAsRetAttr()
554 bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { in hasAttribute()
564 Attribute::AttrKind AttributeImpl::getKindAsEnum() const { in getKindAsEnum()
627 AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<Attribute> Attrs) { in get()
632 Attribute::AttrKind Kind) const { in addAttribute()
660 Attribute::AttrKind Kind) const { in removeAttribute()
690 bool AttributeSet::hasAttribute(Attribute::AttrKind Kind) const { in hasAttribute()
698 Attribute AttributeSet::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
699 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
702 Attribute AttributeSet::getAttribute(StringRef Kind) const { in getAttribute()
703 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
723 return SetNode ? SetNode->getAttributeType(Attribute::ByRef) : nullptr; in getByRefType()
727 return SetNode ? SetNode->getAttributeType(Attribute::ByVal) : nullptr; in getByValType()
731 return SetNode ? SetNode->getAttributeType(Attribute::StructRet) : nullptr; in getStructRetType()
735 return SetNode ? SetNode->getAttributeType(Attribute::Preallocated) : nullptr; in getPreallocatedType()
739 return SetNode ? SetNode->getAttributeType(Attribute::InAlloca) : nullptr; in getInAllocaType()
743 return SetNode ? SetNode->getAttributeType(Attribute::ElementType) : nullptr; in getElementType()
799 AttributeSetNode::AttributeSetNode(ArrayRef<Attribute> Attrs) in AttributeSetNode()
802 llvm::copy(Attrs, getTrailingObjects<Attribute>()); in AttributeSetNode()
813 ArrayRef<Attribute> Attrs) { in get()
814 SmallVector<Attribute, 8> SortedAttrs(Attrs.begin(), Attrs.end()); in get()
820 ArrayRef<Attribute> SortedAttrs) { in getSorted()
840 void *Mem = ::operator new(totalSizeToAlloc<Attribute>(SortedAttrs.size())); in getSorted()
857 Optional<Attribute>
858 AttributeSetNode::findEnumAttribute(Attribute::AttrKind Kind) const { in findEnumAttribute()
865 const Attribute *I = in findEnumAttribute()
867 [](Attribute A, Attribute::AttrKind Kind) { in findEnumAttribute()
874 Attribute AttributeSetNode::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
880 Attribute AttributeSetNode::getAttribute(StringRef Kind) const { in getAttribute()
885 if (auto A = findEnumAttribute(Attribute::Alignment)) in getAlignment()
891 if (auto A = findEnumAttribute(Attribute::StackAlignment)) in getStackAlignment()
896 Type *AttributeSetNode::getAttributeType(Attribute::AttrKind Kind) const { in getAttributeType()
903 if (auto A = findEnumAttribute(Attribute::Dereferenceable)) in getDereferenceableBytes()
909 if (auto A = findEnumAttribute(Attribute::DereferenceableOrNull)) in getDereferenceableOrNullBytes()
916 if (auto A = findEnumAttribute(Attribute::AllocSize)) in getAllocSizeArgs()
922 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeMin()
928 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeMax()
934 if (auto A = findEnumAttribute(Attribute::UWTable)) in getUWTableKind()
940 if (auto A = findEnumAttribute(Attribute::AllocKind)) in getAllocKind()
994 bool AttributeListImpl::hasAttrSomewhere(Attribute::AttrKind Kind, in hasAttrSomewhere()
1051 ArrayRef<std::pair<unsigned, Attribute>> Attrs) { in get()
1059 [](const std::pair<unsigned, Attribute> &Pair) { in get()
1067 for (ArrayRef<std::pair<unsigned, Attribute>>::iterator I = Attrs.begin(), in get()
1070 SmallVector<Attribute, 4> AttrVec; in get()
1167 ArrayRef<Attribute::AttrKind> Kinds) { in get()
1168 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1170 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1175 ArrayRef<Attribute::AttrKind> Kinds, in get()
1178 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1181 Attrs.emplace_back(Index, Attribute::get(C, K, *VI++)); in get()
1187 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1189 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1221 Attribute::AttrKind Kind) const { in addAttributeAtIndex()
1226 SmallVector<Attribute, 8> NewAttrs(Attrs.begin(), Attrs.end()); in addAttributeAtIndex()
1227 NewAttrs.push_back(Attribute::get(C, Kind)); in addAttributeAtIndex()
1240 Attribute A) const { in addAttributeAtIndex()
1273 Attribute A) const { in addParamAttribute()
1293 Attribute::AttrKind Kind) const { in removeAttributeAtIndex()
1393 Attribute::AttrKind Kind) const { in hasAttributeAtIndex()
1405 bool AttributeList::hasFnAttr(Attribute::AttrKind Kind) const { in hasFnAttr()
1413 bool AttributeList::hasAttrSomewhere(Attribute::AttrKind Attr, in hasAttrSomewhere()
1418 Attribute AttributeList::getAttributeAtIndex(unsigned Index, in getAttributeAtIndex()
1419 Attribute::AttrKind Kind) const { in getAttributeAtIndex()
1423 Attribute AttributeList::getAttributeAtIndex(unsigned Index, in getAttributeAtIndex()
1573 bool operator()(Attribute A0, Attribute A1) const { in operator ()()
1586 bool operator()(Attribute A0, Attribute::AttrKind Kind) const { in operator ()()
1591 bool operator()(Attribute A0, StringRef Kind) const { in operator ()()
1599 static void addAttributeImpl(SmallVectorImpl<Attribute> &Attrs, K Kind, in addAttributeImpl()
1600 Attribute Attr) { in addAttributeImpl()
1608 AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { in addAttribute()
1616 AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrKind Kind) { in addAttribute()
1617 addAttributeImpl(Attrs, Kind, Attribute::get(Ctx, Kind)); in addAttribute()
1622 addAttributeImpl(Attrs, A, Attribute::get(Ctx, A, V)); in addAttribute()
1626 AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) { in removeAttribute()
1627 assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!"); in removeAttribute()
1641 uint64_t AttrBuilder::getRawIntAttr(Attribute::AttrKind Kind) const { in getRawIntAttr()
1642 assert(Attribute::isIntAttrKind(Kind) && "Not an int attribute"); in getRawIntAttr()
1643 Attribute A = getAttribute(Kind); in getRawIntAttr()
1647 AttrBuilder &AttrBuilder::addRawIntAttr(Attribute::AttrKind Kind, in addRawIntAttr()
1649 return addAttribute(Attribute::get(Ctx, Kind, Value)); in addRawIntAttr()
1653 return unpackAllocSizeArgs(getRawIntAttr(Attribute::AllocSize)); in getAllocSizeArgs()
1657 return unpackVScaleRangeArgs(getRawIntAttr(Attribute::VScaleRange)).first; in getVScaleRangeMin()
1661 return unpackVScaleRangeArgs(getRawIntAttr(Attribute::VScaleRange)).second; in getVScaleRangeMax()
1669 return addRawIntAttr(Attribute::Alignment, Align->value()); in addAlignmentAttr()
1678 return addRawIntAttr(Attribute::StackAlignment, Align->value()); in addStackAlignmentAttr()
1684 return addRawIntAttr(Attribute::Dereferenceable, Bytes); in addDereferenceableAttr()
1691 return addRawIntAttr(Attribute::DereferenceableOrNull, Bytes); in addDereferenceableOrNullAttr()
1702 return addRawIntAttr(Attribute::AllocSize, RawArgs); in addAllocSizeAttrFromRawRepr()
1715 return addRawIntAttr(Attribute::VScaleRange, RawArgs); in addVScaleRangeAttrFromRawRepr()
1721 return addRawIntAttr(Attribute::UWTable, uint64_t(Kind)); in addUWTableAttr()
1725 return addRawIntAttr(Attribute::AllocKind, static_cast<uint64_t>(Kind)); in addAllocKindAttr()
1728 Type *AttrBuilder::getTypeAttr(Attribute::AttrKind Kind) const { in getTypeAttr()
1729 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in getTypeAttr()
1730 Attribute A = getAttribute(Kind); in getTypeAttr()
1734 AttrBuilder &AttrBuilder::addTypeAttr(Attribute::AttrKind Kind, Type *Ty) { in addTypeAttr()
1735 return addAttribute(Attribute::get(Ctx, Kind, Ty)); in addTypeAttr()
1739 return addTypeAttr(Attribute::ByVal, Ty); in addByValAttr()
1743 return addTypeAttr(Attribute::StructRet, Ty); in addStructRetAttr()
1747 return addTypeAttr(Attribute::ByRef, Ty); in addByRefAttr()
1751 return addTypeAttr(Attribute::Preallocated, Ty); in addPreallocatedAttr()
1755 return addTypeAttr(Attribute::InAlloca, Ty); in addInAllocaAttr()
1767 erase_if(Attrs, [&](Attribute A) { return AM.contains(A); }); in remove()
1772 return any_of(Attrs, [&](Attribute A) { return AM.contains(A); }); in overlaps()
1775 Attribute AttrBuilder::getAttribute(Attribute::AttrKind A) const { in getAttribute()
1776 assert((unsigned)A < Attribute::EndAttrKinds && "Attribute out of range!"); in getAttribute()
1783 Attribute AttrBuilder::getAttribute(StringRef A) const { in getAttribute()
1790 bool AttrBuilder::contains(Attribute::AttrKind A) const { in contains()
1799 return getRawIntAttr(Attribute::Alignment) != 0; in hasAlignmentAttr()
1818 Incompatible.addAttribute(Attribute::AllocAlign); in typeIncompatible()
1820 Incompatible.addAttribute(Attribute::SExt).addAttribute(Attribute::ZExt); in typeIncompatible()
1826 Incompatible.addAttribute(Attribute::NoAlias) in typeIncompatible()
1827 .addAttribute(Attribute::NoCapture) in typeIncompatible()
1828 .addAttribute(Attribute::NonNull) in typeIncompatible()
1829 .addAttribute(Attribute::ReadNone) in typeIncompatible()
1830 .addAttribute(Attribute::ReadOnly) in typeIncompatible()
1831 .addAttribute(Attribute::Dereferenceable) in typeIncompatible()
1832 .addAttribute(Attribute::DereferenceableOrNull); in typeIncompatible()
1834 Incompatible.addAttribute(Attribute::Nest) in typeIncompatible()
1835 .addAttribute(Attribute::SwiftError) in typeIncompatible()
1836 .addAttribute(Attribute::Preallocated) in typeIncompatible()
1837 .addAttribute(Attribute::InAlloca) in typeIncompatible()
1838 .addAttribute(Attribute::ByVal) in typeIncompatible()
1839 .addAttribute(Attribute::StructRet) in typeIncompatible()
1840 .addAttribute(Attribute::ByRef) in typeIncompatible()
1841 .addAttribute(Attribute::ElementType) in typeIncompatible()
1842 .addAttribute(Attribute::AllocatedPointer); in typeIncompatible()
1848 Incompatible.addAttribute(Attribute::Alignment); in typeIncompatible()
1854 Incompatible.addAttribute(Attribute::NoUndef); in typeIncompatible()
1862 AM.addAttribute(Attribute::NoUndef); in getUBImplyingAttributes()
1863 AM.addAttribute(Attribute::Dereferenceable); in getUBImplyingAttributes()
1864 AM.addAttribute(Attribute::DereferenceableOrNull); in getUBImplyingAttributes()
1911 OldSSPAttr.addAttribute(Attribute::StackProtect) in adjustCallerSSPLevel()
1912 .addAttribute(Attribute::StackProtectStrong) in adjustCallerSSPLevel()
1913 .addAttribute(Attribute::StackProtectReq); in adjustCallerSSPLevel()
1915 if (Callee.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
1917 Caller.addFnAttr(Attribute::StackProtectReq); in adjustCallerSSPLevel()
1918 } else if (Callee.hasFnAttribute(Attribute::StackProtectStrong) && in adjustCallerSSPLevel()
1919 !Caller.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
1921 Caller.addFnAttr(Attribute::StackProtectStrong); in adjustCallerSSPLevel()
1922 } else if (Callee.hasFnAttribute(Attribute::StackProtect) && in adjustCallerSSPLevel()
1923 !Caller.hasFnAttribute(Attribute::StackProtectReq) && in adjustCallerSSPLevel()
1924 !Caller.hasFnAttribute(Attribute::StackProtectStrong)) in adjustCallerSSPLevel()
1925 Caller.addFnAttr(Attribute::StackProtect); in adjustCallerSSPLevel()
1942 Attribute CalleeAttr = Callee.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
1944 Attribute CallerAttr = Caller.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
1970 Attribute CallerAttr = Caller.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
1972 Attribute CalleeAttr = Callee.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
1992 Caller.addFnAttr(Attribute::NullPointerIsValid); in adjustNullPointerValidAttr()
1998 Attribute::AttrKind Kind) { in isSet()
2003 Attribute::AttrKind Kind, bool Val) { in set()
2027 static enum Attribute::AttrKind getKind() { \
2028 return llvm::Attribute::ENUM_NAME; \
2070 Attribute Attr = Fn.getFnAttribute("min-legal-vector-width"); in updateMinLegalVectorWidthAttr()