Lines Matching refs:Attribute
92 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
95 assert(Attribute::isIntAttrKind(Kind) && "Not an int attribute"); in get()
97 assert(Attribute::isEnumAttrKind(Kind) && "Not an enum attribute"); in get()
118 return Attribute(PA); in get()
121 Attribute Attribute::get(LLVMContext &Context, StringRef Kind, StringRef Val) { in get()
141 return Attribute(PA); in get()
144 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
146 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in get()
163 return Attribute(PA); in get()
166 Attribute Attribute::getWithAlignment(LLVMContext &Context, Align A) { in getWithAlignment()
171 Attribute Attribute::getWithStackAlignment(LLVMContext &Context, Align A) { in getWithStackAlignment()
176 Attribute Attribute::getWithDereferenceableBytes(LLVMContext &Context, in getWithDereferenceableBytes()
182 Attribute Attribute::getWithDereferenceableOrNullBytes(LLVMContext &Context, in getWithDereferenceableOrNullBytes()
188 Attribute Attribute::getWithByValType(LLVMContext &Context, Type *Ty) { in getWithByValType()
192 Attribute Attribute::getWithStructRetType(LLVMContext &Context, Type *Ty) { in getWithStructRetType()
196 Attribute Attribute::getWithByRefType(LLVMContext &Context, Type *Ty) { in getWithByRefType()
200 Attribute Attribute::getWithPreallocatedType(LLVMContext &Context, Type *Ty) { in getWithPreallocatedType()
204 Attribute Attribute::getWithInAllocaType(LLVMContext &Context, Type *Ty) { in getWithInAllocaType()
208 Attribute
209 Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg, in getWithAllocSizeArgs()
216 Attribute Attribute::getWithVScaleRangeArgs(LLVMContext &Context, in getWithVScaleRangeArgs()
222 Attribute::AttrKind Attribute::getAttrKindFromName(StringRef AttrName) { in getAttrKindFromName()
223 return StringSwitch<Attribute::AttrKind>(AttrName) in getAttrKindFromName()
226 .Case(#DISPLAY_NAME, Attribute::ENUM_NAME) in getAttrKindFromName()
228 .Default(Attribute::None); in getAttrKindFromName()
231 StringRef Attribute::getNameFromAttrKind(Attribute::AttrKind AttrKind) { in getNameFromAttrKind()
235 case Attribute::ENUM_NAME: \ in getNameFromAttrKind()
238 case Attribute::None: in getNameFromAttrKind()
245 bool Attribute::isExistingAttribute(StringRef Name) { in isExistingAttribute()
257 bool Attribute::isEnumAttribute() const { in isEnumAttribute()
261 bool Attribute::isIntAttribute() const { in isIntAttribute()
265 bool Attribute::isStringAttribute() const { in isStringAttribute()
269 bool Attribute::isTypeAttribute() const { in isTypeAttribute()
273 Attribute::AttrKind Attribute::getKindAsEnum() const { in getKindAsEnum()
280 uint64_t Attribute::getValueAsInt() const { in getValueAsInt()
287 bool Attribute::getValueAsBool() const { in getValueAsBool()
294 StringRef Attribute::getKindAsString() const { in getKindAsString()
301 StringRef Attribute::getValueAsString() const { in getValueAsString()
308 Type *Attribute::getValueAsType() const { in getValueAsType()
316 bool Attribute::hasAttribute(AttrKind Kind) const { in hasAttribute()
320 bool Attribute::hasAttribute(StringRef Kind) const { in hasAttribute()
325 MaybeAlign Attribute::getAlignment() const { in getAlignment()
326 assert(hasAttribute(Attribute::Alignment) && in getAlignment()
331 MaybeAlign Attribute::getStackAlignment() const { in getStackAlignment()
332 assert(hasAttribute(Attribute::StackAlignment) && in getStackAlignment()
337 uint64_t Attribute::getDereferenceableBytes() const { in getDereferenceableBytes()
338 assert(hasAttribute(Attribute::Dereferenceable) && in getDereferenceableBytes()
344 uint64_t Attribute::getDereferenceableOrNullBytes() const { in getDereferenceableOrNullBytes()
345 assert(hasAttribute(Attribute::DereferenceableOrNull) && in getDereferenceableOrNullBytes()
351 std::pair<unsigned, Optional<unsigned>> Attribute::getAllocSizeArgs() const { in getAllocSizeArgs()
352 assert(hasAttribute(Attribute::AllocSize) && in getAllocSizeArgs()
357 std::pair<unsigned, unsigned> Attribute::getVScaleRangeArgs() const { in getVScaleRangeArgs()
358 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeArgs()
363 std::string Attribute::getAsString(bool InAttrGrp) const { in getAsString()
384 if (hasAttribute(Attribute::Alignment)) { in getAsString()
406 if (hasAttribute(Attribute::StackAlignment)) in getAsString()
409 if (hasAttribute(Attribute::Dereferenceable)) in getAsString()
412 if (hasAttribute(Attribute::DereferenceableOrNull)) in getAsString()
415 if (hasAttribute(Attribute::AllocSize)) { in getAsString()
430 if (hasAttribute(Attribute::VScaleRange)) { in getAsString()
469 bool Attribute::hasParentContext(LLVMContext &C) const { in hasParentContext()
477 bool Attribute::operator<(Attribute A) const { in operator <()
484 void Attribute::Profile(FoldingSetNodeID &ID) const { in Profile()
497 static bool hasAttributeProperty(Attribute::AttrKind Kind, in hasAttributeProperty()
505 bool Attribute::canUseAsFnAttr(AttrKind Kind) { in canUseAsFnAttr()
509 bool Attribute::canUseAsParamAttr(AttrKind Kind) { in canUseAsParamAttr()
513 bool Attribute::canUseAsRetAttr(AttrKind Kind) { in canUseAsRetAttr()
521 bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { in hasAttribute()
531 Attribute::AttrKind AttributeImpl::getKindAsEnum() const { in getKindAsEnum()
594 AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<Attribute> Attrs) { in get()
599 Attribute::AttrKind Kind) const { in addAttribute()
629 Attribute::AttrKind Kind) const { in removeAttribute()
659 bool AttributeSet::hasAttribute(Attribute::AttrKind Kind) const { in hasAttribute()
667 Attribute AttributeSet::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
668 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
671 Attribute AttributeSet::getAttribute(StringRef Kind) const { in getAttribute()
672 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
692 return SetNode ? SetNode->getAttributeType(Attribute::ByRef) : nullptr; in getByRefType()
696 return SetNode ? SetNode->getAttributeType(Attribute::ByVal) : nullptr; in getByValType()
700 return SetNode ? SetNode->getAttributeType(Attribute::StructRet) : nullptr; in getStructRetType()
704 return SetNode ? SetNode->getAttributeType(Attribute::Preallocated) : nullptr; in getPreallocatedType()
708 return SetNode ? SetNode->getAttributeType(Attribute::InAlloca) : nullptr; in getInAllocaType()
712 return SetNode ? SetNode->getAttributeType(Attribute::ElementType) : nullptr; in getElementType()
757 AttributeSetNode::AttributeSetNode(ArrayRef<Attribute> Attrs) in AttributeSetNode()
760 llvm::copy(Attrs, getTrailingObjects<Attribute>()); in AttributeSetNode()
771 ArrayRef<Attribute> Attrs) { in get()
772 SmallVector<Attribute, 8> SortedAttrs(Attrs.begin(), Attrs.end()); in get()
778 ArrayRef<Attribute> SortedAttrs) { in getSorted()
798 void *Mem = ::operator new(totalSizeToAlloc<Attribute>(SortedAttrs.size())); in getSorted()
809 SmallVector<Attribute, 8> Attrs; in get()
810 for (Attribute::AttrKind Kind = Attribute::None; in get()
811 Kind != Attribute::EndAttrKinds; Kind = Attribute::AttrKind(Kind + 1)) { in get()
815 if (Attribute::isTypeAttrKind(Kind)) { in get()
816 Attrs.push_back(Attribute::get(C, Kind, B.getTypeAttr(Kind))); in get()
820 Attribute Attr; in get()
822 case Attribute::Alignment: in get()
824 Attr = Attribute::getWithAlignment(C, *B.getAlignment()); in get()
826 case Attribute::StackAlignment: in get()
828 Attr = Attribute::getWithStackAlignment(C, *B.getStackAlignment()); in get()
830 case Attribute::Dereferenceable: in get()
831 Attr = Attribute::getWithDereferenceableBytes( in get()
834 case Attribute::DereferenceableOrNull: in get()
835 Attr = Attribute::getWithDereferenceableOrNullBytes( in get()
838 case Attribute::AllocSize: { in get()
840 Attr = Attribute::getWithAllocSizeArgs(C, A.first, A.second); in get()
843 case Attribute::VScaleRange: { in get()
845 Attr = Attribute::getWithVScaleRangeArgs(C, A.first, A.second); in get()
849 Attr = Attribute::get(C, Kind); in get()
856 Attrs.emplace_back(Attribute::get(C, TDA.first, TDA.second)); in get()
865 Optional<Attribute>
866 AttributeSetNode::findEnumAttribute(Attribute::AttrKind Kind) const { in findEnumAttribute()
873 const Attribute *I = in findEnumAttribute()
875 [](Attribute A, Attribute::AttrKind Kind) { in findEnumAttribute()
882 Attribute AttributeSetNode::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
888 Attribute AttributeSetNode::getAttribute(StringRef Kind) const { in getAttribute()
893 if (auto A = findEnumAttribute(Attribute::Alignment)) in getAlignment()
899 if (auto A = findEnumAttribute(Attribute::StackAlignment)) in getStackAlignment()
904 Type *AttributeSetNode::getAttributeType(Attribute::AttrKind Kind) const { in getAttributeType()
911 if (auto A = findEnumAttribute(Attribute::Dereferenceable)) in getDereferenceableBytes()
917 if (auto A = findEnumAttribute(Attribute::DereferenceableOrNull)) in getDereferenceableOrNullBytes()
924 if (auto A = findEnumAttribute(Attribute::AllocSize)) in getAllocSizeArgs()
930 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeArgs()
984 bool AttributeListImpl::hasAttrSomewhere(Attribute::AttrKind Kind, in hasAttrSomewhere()
1041 ArrayRef<std::pair<unsigned, Attribute>> Attrs) { in get()
1047 [](const std::pair<unsigned, Attribute> &LHS, in get()
1048 const std::pair<unsigned, Attribute> &RHS) { in get()
1053 [](const std::pair<unsigned, Attribute> &Pair) { in get()
1061 for (ArrayRef<std::pair<unsigned, Attribute>>::iterator I = Attrs.begin(), in get()
1064 SmallVector<Attribute, 4> AttrVec; in get()
1160 ArrayRef<Attribute::AttrKind> Kinds) { in get()
1161 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1163 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1168 ArrayRef<Attribute::AttrKind> Kinds, in get()
1171 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1174 Attrs.emplace_back(Index, Attribute::get(C, K, *VI++)); in get()
1180 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1182 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1213 Attribute::AttrKind Kind) const { in addAttribute()
1217 SmallVector<Attribute, 8> NewAttrs(Attrs.begin(), Attrs.end()); in addAttribute()
1218 NewAttrs.push_back(Attribute::get(C, Kind)); in addAttribute()
1231 Attribute A) const { in addAttribute()
1271 Attribute A) const { in addParamAttribute()
1290 Attribute::AttrKind Kind) const { in removeAttribute()
1388 Attribute::AttrKind Kind) const { in hasAttribute()
1400 bool AttributeList::hasFnAttribute(Attribute::AttrKind Kind) const { in hasFnAttribute()
1409 Attribute::AttrKind Kind) const { in hasParamAttribute()
1413 bool AttributeList::hasAttrSomewhere(Attribute::AttrKind Attr, in hasAttrSomewhere()
1418 Attribute AttributeList::getAttribute(unsigned Index, in getAttribute()
1419 Attribute::AttrKind Kind) const { in getAttribute()
1423 Attribute AttributeList::getAttribute(unsigned Index, StringRef Kind) const { in getAttribute()
1575 AttrBuilder::kindToTypeIndex(Attribute::AttrKind Kind) const { in kindToTypeIndex()
1576 if (Attribute::isTypeAttrKind(Kind)) in kindToTypeIndex()
1577 return Kind - Attribute::FirstTypeAttr; in kindToTypeIndex()
1581 AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { in addAttribute()
1587 Attribute::AttrKind Kind = Attr.getKindAsEnum(); in addAttribute()
1592 else if (Kind == Attribute::Alignment) in addAttribute()
1594 else if (Kind == Attribute::StackAlignment) in addAttribute()
1596 else if (Kind == Attribute::Dereferenceable) in addAttribute()
1598 else if (Kind == Attribute::DereferenceableOrNull) in addAttribute()
1600 else if (Kind == Attribute::AllocSize) in addAttribute()
1602 else if (Kind == Attribute::VScaleRange) in addAttribute()
1613 AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) { in removeAttribute()
1614 assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!"); in removeAttribute()
1619 else if (Val == Attribute::Alignment) in removeAttribute()
1621 else if (Val == Attribute::StackAlignment) in removeAttribute()
1623 else if (Val == Attribute::Dereferenceable) in removeAttribute()
1625 else if (Val == Attribute::DereferenceableOrNull) in removeAttribute()
1627 else if (Val == Attribute::AllocSize) in removeAttribute()
1629 else if (Val == Attribute::VScaleRange) in removeAttribute()
1661 Attrs[Attribute::Alignment] = true; in addAlignmentAttr()
1673 Attrs[Attribute::StackAlignment] = true; in addStackAlignmentAttr()
1681 Attrs[Attribute::Dereferenceable] = true; in addDereferenceableAttr()
1690 Attrs[Attribute::DereferenceableOrNull] = true; in addDereferenceableOrNullAttr()
1704 Attrs[Attribute::AllocSize] = true; in addAllocSizeAttrFromRawRepr()
1721 Attrs[Attribute::VScaleRange] = true; in addVScaleRangeAttrFromRawRepr()
1728 Type *AttrBuilder::getTypeAttr(Attribute::AttrKind Kind) const { in getTypeAttr()
1734 AttrBuilder &AttrBuilder::addTypeAttr(Attribute::AttrKind Kind, Type *Ty) { in addTypeAttr()
1743 return addTypeAttr(Attribute::ByVal, Ty); in addByValAttr()
1747 return addTypeAttr(Attribute::StructRet, Ty); in addStructRetAttr()
1751 return addTypeAttr(Attribute::ByRef, Ty); in addByRefAttr()
1755 return addTypeAttr(Attribute::Preallocated, Ty); in addPreallocatedAttr()
1759 return addTypeAttr(Attribute::InAlloca, Ty); in addInAllocaAttr()
1782 for (unsigned Index = 0; Index < Attribute::NumTypeAttrKinds; ++Index) in merge()
1814 for (unsigned Index = 0; Index < Attribute::NumTypeAttrKinds; ++Index) in remove()
1890 Incompatible.addAttribute(Attribute::SExt) in typeIncompatible()
1891 .addAttribute(Attribute::ZExt); in typeIncompatible()
1895 Incompatible.addAttribute(Attribute::Nest) in typeIncompatible()
1896 .addAttribute(Attribute::NoAlias) in typeIncompatible()
1897 .addAttribute(Attribute::NoCapture) in typeIncompatible()
1898 .addAttribute(Attribute::NonNull) in typeIncompatible()
1899 .addAttribute(Attribute::ReadNone) in typeIncompatible()
1900 .addAttribute(Attribute::ReadOnly) in typeIncompatible()
1901 .addAttribute(Attribute::SwiftError) in typeIncompatible()
1910 .addTypeAttr(Attribute::ElementType, Ty); in typeIncompatible()
1914 Incompatible.addAttribute(Attribute::NoUndef); in typeIncompatible()
1921 B.addAttribute(Attribute::NoUndef); in getUBImplyingAttributes()
1964 OldSSPAttr.addAttribute(Attribute::StackProtect) in adjustCallerSSPLevel()
1965 .addAttribute(Attribute::StackProtectStrong) in adjustCallerSSPLevel()
1966 .addAttribute(Attribute::StackProtectReq); in adjustCallerSSPLevel()
1968 if (Callee.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
1970 Caller.addFnAttr(Attribute::StackProtectReq); in adjustCallerSSPLevel()
1971 } else if (Callee.hasFnAttribute(Attribute::StackProtectStrong) && in adjustCallerSSPLevel()
1972 !Caller.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
1974 Caller.addFnAttr(Attribute::StackProtectStrong); in adjustCallerSSPLevel()
1975 } else if (Callee.hasFnAttribute(Attribute::StackProtect) && in adjustCallerSSPLevel()
1976 !Caller.hasFnAttribute(Attribute::StackProtectReq) && in adjustCallerSSPLevel()
1977 !Caller.hasFnAttribute(Attribute::StackProtectStrong)) in adjustCallerSSPLevel()
1978 Caller.addFnAttr(Attribute::StackProtect); in adjustCallerSSPLevel()
1995 Attribute CalleeAttr = Callee.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
1997 Attribute CallerAttr = Caller.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
2023 Attribute CallerAttr = Caller.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
2025 Attribute CalleeAttr = Callee.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
2045 Caller.addFnAttr(Attribute::NullPointerIsValid); in adjustNullPointerValidAttr()
2051 Attribute::AttrKind Kind) { in isSet()
2056 Attribute::AttrKind Kind, bool Val) { in set()
2080 static enum Attribute::AttrKind getKind() { \
2081 return llvm::Attribute::ENUM_NAME; \