Lines Matching full:attribute
10 // This file implements the Attribute, AttributeImpl, AttrBuilder,
49 // Attribute Construction Methods
94 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
96 bool IsIntAttr = Attribute::isIntAttrKind(Kind); in get()
97 assert((IsIntAttr || Attribute::isEnumAttrKind(Kind)) && in get()
98 "Not an enum or int attribute"); in get()
121 // Return the Attribute that we found or created. in get()
122 return Attribute(PA); in get()
125 Attribute Attribute::get(LLVMContext &Context, StringRef Kind, StringRef Val) { in get()
144 // Return the Attribute that we found or created. in get()
145 return Attribute(PA); in get()
148 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
150 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in get()
166 // Return the Attribute that we found or created. in get()
167 return Attribute(PA); in get()
170 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
172 assert(Attribute::isConstantRangeAttrKind(Kind) && in get()
173 "Not a ConstantRange attribute"); in get()
191 // Return the Attribute that we found or created. in get()
192 return Attribute(PA); in get()
195 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind, in get()
197 assert(Attribute::isConstantRangeListAttrKind(Kind) && in get()
198 "Not a ConstantRangeList attribute"); in get()
228 // Return the Attribute that we found or created. in get()
229 return Attribute(PA); in get()
232 Attribute Attribute::getWithAlignment(LLVMContext &Context, Align A) { in getWithAlignment()
237 Attribute Attribute::getWithStackAlignment(LLVMContext &Context, Align A) { in getWithStackAlignment()
242 Attribute Attribute::getWithDereferenceableBytes(LLVMContext &Context, in getWithDereferenceableBytes()
248 Attribute Attribute::getWithDereferenceableOrNullBytes(LLVMContext &Context, in getWithDereferenceableOrNullBytes()
254 Attribute Attribute::getWithByValType(LLVMContext &Context, Type *Ty) { in getWithByValType()
258 Attribute Attribute::getWithStructRetType(LLVMContext &Context, Type *Ty) { in getWithStructRetType()
262 Attribute Attribute::getWithByRefType(LLVMContext &Context, Type *Ty) { in getWithByRefType()
266 Attribute Attribute::getWithPreallocatedType(LLVMContext &Context, Type *Ty) { in getWithPreallocatedType()
270 Attribute Attribute::getWithInAllocaType(LLVMContext &Context, Type *Ty) { in getWithInAllocaType()
274 Attribute Attribute::getWithUWTableKind(LLVMContext &Context, in getWithUWTableKind()
279 Attribute Attribute::getWithMemoryEffects(LLVMContext &Context, in getWithMemoryEffects()
284 Attribute Attribute::getWithNoFPClass(LLVMContext &Context, in getWithNoFPClass()
289 Attribute
290 Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg, in getWithAllocSizeArgs()
297 Attribute Attribute::getWithVScaleRangeArgs(LLVMContext &Context, in getWithVScaleRangeArgs()
303 Attribute::AttrKind Attribute::getAttrKindFromName(StringRef AttrName) { in getAttrKindFromName()
304 return StringSwitch<Attribute::AttrKind>(AttrName) in getAttrKindFromName()
307 .Case(#DISPLAY_NAME, Attribute::ENUM_NAME) in getAttrKindFromName()
309 .Default(Attribute::None); in getAttrKindFromName()
312 StringRef Attribute::getNameFromAttrKind(Attribute::AttrKind AttrKind) { in getNameFromAttrKind()
316 case Attribute::ENUM_NAME: \ in getNameFromAttrKind()
319 case Attribute::None: in getNameFromAttrKind()
326 bool Attribute::isExistingAttribute(StringRef Name) { in isExistingAttribute()
335 // Attribute Accessor Methods
338 bool Attribute::isEnumAttribute() const { in isEnumAttribute()
342 bool Attribute::isIntAttribute() const { in isIntAttribute()
346 bool Attribute::isStringAttribute() const { in isStringAttribute()
350 bool Attribute::isTypeAttribute() const { in isTypeAttribute()
354 bool Attribute::isConstantRangeAttribute() const { in isConstantRangeAttribute()
358 bool Attribute::isConstantRangeListAttribute() const { in isConstantRangeListAttribute()
362 Attribute::AttrKind Attribute::getKindAsEnum() const { in getKindAsEnum()
366 "Invalid attribute type to get the kind as an enum!"); in getKindAsEnum()
370 uint64_t Attribute::getValueAsInt() const { in getValueAsInt()
373 "Expected the attribute to be an integer attribute!"); in getValueAsInt()
377 bool Attribute::getValueAsBool() const { in getValueAsBool()
380 "Expected the attribute to be a string attribute!"); in getValueAsBool()
384 StringRef Attribute::getKindAsString() const { in getKindAsString()
387 "Invalid attribute type to get the kind as a string!"); in getKindAsString()
391 StringRef Attribute::getValueAsString() const { in getValueAsString()
394 "Invalid attribute type to get the value as a string!"); in getValueAsString()
398 Type *Attribute::getValueAsType() const { in getValueAsType()
401 "Invalid attribute type to get the value as a type!"); in getValueAsType()
405 const ConstantRange &Attribute::getValueAsConstantRange() const { in getValueAsConstantRange()
407 "Invalid attribute type to get the value as a ConstantRange!"); in getValueAsConstantRange()
411 ArrayRef<ConstantRange> Attribute::getValueAsConstantRangeList() const { in getValueAsConstantRangeList()
413 "Invalid attribute type to get the value as a ConstantRangeList!"); in getValueAsConstantRangeList()
417 bool Attribute::hasAttribute(AttrKind Kind) const { in hasAttribute()
421 bool Attribute::hasAttribute(StringRef Kind) const { in hasAttribute()
426 MaybeAlign Attribute::getAlignment() const { in getAlignment()
427 assert(hasAttribute(Attribute::Alignment) && in getAlignment()
428 "Trying to get alignment from non-alignment attribute!"); in getAlignment()
432 MaybeAlign Attribute::getStackAlignment() const { in getStackAlignment()
433 assert(hasAttribute(Attribute::StackAlignment) && in getStackAlignment()
434 "Trying to get alignment from non-alignment attribute!"); in getStackAlignment()
438 uint64_t Attribute::getDereferenceableBytes() const { in getDereferenceableBytes()
439 assert(hasAttribute(Attribute::Dereferenceable) && in getDereferenceableBytes()
441 "non-dereferenceable attribute!"); in getDereferenceableBytes()
445 uint64_t Attribute::getDereferenceableOrNullBytes() const { in getDereferenceableOrNullBytes()
446 assert(hasAttribute(Attribute::DereferenceableOrNull) && in getDereferenceableOrNullBytes()
448 "non-dereferenceable attribute!"); in getDereferenceableOrNullBytes()
453 Attribute::getAllocSizeArgs() const { in getAllocSizeArgs()
454 assert(hasAttribute(Attribute::AllocSize) && in getAllocSizeArgs()
455 "Trying to get allocsize args from non-allocsize attribute"); in getAllocSizeArgs()
459 unsigned Attribute::getVScaleRangeMin() const { in getVScaleRangeMin()
460 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeMin()
461 "Trying to get vscale args from non-vscale attribute"); in getVScaleRangeMin()
465 std::optional<unsigned> Attribute::getVScaleRangeMax() const { in getVScaleRangeMax()
466 assert(hasAttribute(Attribute::VScaleRange) && in getVScaleRangeMax()
467 "Trying to get vscale args from non-vscale attribute"); in getVScaleRangeMax()
471 UWTableKind Attribute::getUWTableKind() const { in getUWTableKind()
472 assert(hasAttribute(Attribute::UWTable) && in getUWTableKind()
473 "Trying to get unwind table kind from non-uwtable attribute"); in getUWTableKind()
477 AllocFnKind Attribute::getAllocKind() const { in getAllocKind()
478 assert(hasAttribute(Attribute::AllocKind) && in getAllocKind()
479 "Trying to get allockind value from non-allockind attribute"); in getAllocKind()
483 MemoryEffects Attribute::getMemoryEffects() const { in getMemoryEffects()
484 assert(hasAttribute(Attribute::Memory) && in getMemoryEffects()
485 "Can only call getMemoryEffects() on memory attribute"); in getMemoryEffects()
489 FPClassTest Attribute::getNoFPClass() const { in getNoFPClass()
490 assert(hasAttribute(Attribute::NoFPClass) && in getNoFPClass()
491 "Can only call getNoFPClass() on nofpclass attribute"); in getNoFPClass()
495 const ConstantRange &Attribute::getRange() const { in getRange()
496 assert(hasAttribute(Attribute::Range) && in getRange()
497 "Trying to get range args from non-range attribute"); in getRange()
501 ArrayRef<ConstantRange> Attribute::getInitializes() const { in getInitializes()
502 assert(hasAttribute(Attribute::Initializes) && in getInitializes()
503 "Trying to get initializes attr from non-ConstantRangeList attribute"); in getInitializes()
521 std::string Attribute::getAsString(bool InAttrGrp) const { in getAsString()
542 if (hasAttribute(Attribute::Alignment)) in getAsString()
553 if (hasAttribute(Attribute::StackAlignment)) in getAsString()
556 if (hasAttribute(Attribute::Dereferenceable)) in getAsString()
559 if (hasAttribute(Attribute::DereferenceableOrNull)) in getAsString()
562 if (hasAttribute(Attribute::AllocSize)) { in getAsString()
573 if (hasAttribute(Attribute::VScaleRange)) { in getAsString()
581 if (hasAttribute(Attribute::UWTable)) { in getAsString()
583 assert(Kind != UWTableKind::None && "uwtable attribute should not be none"); in getAsString()
587 if (hasAttribute(Attribute::AllocKind)) { in getAsString()
607 if (hasAttribute(Attribute::Memory)) { in getAsString()
649 if (hasAttribute(Attribute::NoFPClass)) { in getAsString()
656 if (hasAttribute(Attribute::Range)) { in getAsString()
668 if (hasAttribute(Attribute::Initializes)) { in getAsString()
690 // Since some attribute strings contain special characters that cannot be in getAsString()
691 // printable, those have to be escaped to make the attribute value in getAsString()
703 llvm_unreachable("Unknown attribute"); in getAsString()
706 bool Attribute::hasParentContext(LLVMContext &C) const { in hasParentContext()
707 assert(isValid() && "invalid Attribute doesn't refer to any context"); in hasParentContext()
714 bool Attribute::operator<(Attribute A) const { in operator <()
721 void Attribute::Profile(FoldingSetNodeID &ID) const { in Profile()
734 static bool hasAttributeProperty(Attribute::AttrKind Kind, in hasAttributeProperty()
737 assert(Index < std::size(AttrPropTable) && "Invalid attribute kind"); in hasAttributeProperty()
741 bool Attribute::canUseAsFnAttr(AttrKind Kind) { in canUseAsFnAttr()
745 bool Attribute::canUseAsParamAttr(AttrKind Kind) { in canUseAsParamAttr()
749 bool Attribute::canUseAsRetAttr(AttrKind Kind) { in canUseAsRetAttr()
757 bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { in hasAttribute()
767 Attribute::AttrKind AttributeImpl::getKindAsEnum() const { in getKindAsEnum()
814 // This sorts the attributes with Attribute::AttrKinds coming first (sorted in operator <()
821 assert(!AI.isEnumAttribute() && "Non-unique attribute"); in operator <()
846 AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<Attribute> Attrs) { in get()
851 Attribute::AttrKind Kind) const { in addAttribute()
879 Attribute::AttrKind Kind) const { in removeAttribute()
909 bool AttributeSet::hasAttribute(Attribute::AttrKind Kind) const { in hasAttribute()
917 Attribute AttributeSet::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
918 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
921 Attribute AttributeSet::getAttribute(StringRef Kind) const { in getAttribute()
922 return SetNode ? SetNode->getAttribute(Kind) : Attribute(); in getAttribute()
942 return SetNode ? SetNode->getAttributeType(Attribute::ByRef) : nullptr; in getByRefType()
946 return SetNode ? SetNode->getAttributeType(Attribute::ByVal) : nullptr; in getByValType()
950 return SetNode ? SetNode->getAttributeType(Attribute::StructRet) : nullptr; in getStructRetType()
954 return SetNode ? SetNode->getAttributeType(Attribute::Preallocated) : nullptr; in getPreallocatedType()
958 return SetNode ? SetNode->getAttributeType(Attribute::InAlloca) : nullptr; in getInAllocaType()
962 return SetNode ? SetNode->getAttributeType(Attribute::ElementType) : nullptr; in getElementType()
1028 AttributeSetNode::AttributeSetNode(ArrayRef<Attribute> Attrs) in AttributeSetNode()
1031 llvm::copy(Attrs, getTrailingObjects<Attribute>()); in AttributeSetNode()
1042 ArrayRef<Attribute> Attrs) { in get()
1043 SmallVector<Attribute, 8> SortedAttrs(Attrs.begin(), Attrs.end()); in get()
1049 ArrayRef<Attribute> SortedAttrs) { in getSorted()
1069 void *Mem = ::operator new(totalSizeToAlloc<Attribute>(SortedAttrs.size())); in getSorted()
1086 std::optional<Attribute>
1087 AttributeSetNode::findEnumAttribute(Attribute::AttrKind Kind) const { in findEnumAttribute()
1094 const Attribute *I = in findEnumAttribute()
1096 [](Attribute A, Attribute::AttrKind Kind) { in findEnumAttribute()
1103 Attribute AttributeSetNode::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
1109 Attribute AttributeSetNode::getAttribute(StringRef Kind) const { in getAttribute()
1114 if (auto A = findEnumAttribute(Attribute::Alignment)) in getAlignment()
1120 if (auto A = findEnumAttribute(Attribute::StackAlignment)) in getStackAlignment()
1125 Type *AttributeSetNode::getAttributeType(Attribute::AttrKind Kind) const { in getAttributeType()
1132 if (auto A = findEnumAttribute(Attribute::Dereferenceable)) in getDereferenceableBytes()
1138 if (auto A = findEnumAttribute(Attribute::DereferenceableOrNull)) in getDereferenceableOrNullBytes()
1145 if (auto A = findEnumAttribute(Attribute::AllocSize)) in getAllocSizeArgs()
1151 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeMin()
1157 if (auto A = findEnumAttribute(Attribute::VScaleRange)) in getVScaleRangeMax()
1163 if (auto A = findEnumAttribute(Attribute::UWTable)) in getUWTableKind()
1169 if (auto A = findEnumAttribute(Attribute::AllocKind)) in getAllocKind()
1175 if (auto A = findEnumAttribute(Attribute::Memory)) in getMemoryEffects()
1181 if (auto A = findEnumAttribute(Attribute::NoFPClass)) in getNoFPClass()
1235 bool AttributeListImpl::hasAttrSomewhere(Attribute::AttrKind Kind, in hasAttrSomewhere()
1292 ArrayRef<std::pair<unsigned, Attribute>> Attrs) { in get()
1300 [](const std::pair<unsigned, Attribute> &Pair) { in get()
1303 "Pointless attribute!"); in get()
1308 for (ArrayRef<std::pair<unsigned, Attribute>>::iterator I = Attrs.begin(), in get()
1311 SmallVector<Attribute, 4> AttrVec; in get()
1336 "Pointless attribute!"); in get()
1356 // AttributeListImpls by dropping empty attribute sets at the end of the list. in get()
1373 // If all attribute sets were empty, we can use the empty attribute list. in get()
1384 // Drop the empty argument attribute sets at the end. in get()
1408 ArrayRef<Attribute::AttrKind> Kinds) { in get()
1409 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1411 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1416 ArrayRef<Attribute::AttrKind> Kinds, in get()
1418 assert(Kinds.size() == Values.size() && "Mismatched attribute values."); in get()
1419 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1422 Attrs.emplace_back(Index, Attribute::get(C, K, *VI++)); in get()
1428 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
1430 Attrs.emplace_back(Index, Attribute::get(C, K)); in get()
1462 Attribute::AttrKind Kind) const { in addAttributeAtIndex()
1467 SmallVector<Attribute, 8> NewAttrs(Attrs.begin(), Attrs.end()); in addAttributeAtIndex()
1468 NewAttrs.push_back(Attribute::get(C, Kind)); in addAttributeAtIndex()
1481 Attribute A) const { in addAttributeAtIndex()
1496 // Remove trailing empty attribute sets. in setAttributesAtIndex()
1520 Attribute A) const { in addParamAttribute()
1540 Attribute::AttrKind Kind) const { in removeAttributeAtIndex()
1633 Attribute::AttrKind Kind) const { in hasAttributeAtIndex()
1645 bool AttributeList::hasFnAttr(Attribute::AttrKind Kind) const { in hasFnAttr()
1653 bool AttributeList::hasAttrSomewhere(Attribute::AttrKind Attr, in hasAttrSomewhere()
1658 Attribute AttributeList::getAttributeAtIndex(unsigned Index, in getAttributeAtIndex()
1659 Attribute::AttrKind Kind) const { in getAttributeAtIndex()
1663 Attribute AttributeList::getAttributeAtIndex(unsigned Index, in getAttributeAtIndex()
1761 assert(!isEmpty() && "an empty attribute list has no parent context"); in hasParentContext()
1822 /// Attribute comparator that only compares attribute keys. Enum attributes are
1825 bool operator()(Attribute A0, Attribute A1) const { in operator ()()
1838 bool operator()(Attribute A0, Attribute::AttrKind Kind) const { in operator ()()
1843 bool operator()(Attribute A0, StringRef Kind) const { in operator ()()
1851 static void addAttributeImpl(SmallVectorImpl<Attribute> &Attrs, K Kind, in addAttributeImpl()
1852 Attribute Attr) { in addAttributeImpl()
1860 AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { in addAttribute()
1868 AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrKind Kind) { in addAttribute()
1869 addAttributeImpl(Attrs, Kind, Attribute::get(Ctx, Kind)); in addAttribute()
1874 addAttributeImpl(Attrs, A, Attribute::get(Ctx, A, V)); in addAttribute()
1878 AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) { in removeAttribute()
1879 assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!"); in removeAttribute()
1894 AttrBuilder::getRawIntAttr(Attribute::AttrKind Kind) const { in getRawIntAttr()
1895 assert(Attribute::isIntAttrKind(Kind) && "Not an int attribute"); in getRawIntAttr()
1896 Attribute A = getAttribute(Kind); in getRawIntAttr()
1902 AttrBuilder &AttrBuilder::addRawIntAttr(Attribute::AttrKind Kind, in addRawIntAttr()
1904 return addAttribute(Attribute::get(Ctx, Kind, Value)); in addRawIntAttr()
1909 Attribute A = getAttribute(Attribute::AllocSize); in getAllocSizeArgs()
1920 return addRawIntAttr(Attribute::Alignment, Align->value()); in addAlignmentAttr()
1929 return addRawIntAttr(Attribute::StackAlignment, Align->value()); in addStackAlignmentAttr()
1935 return addRawIntAttr(Attribute::Dereferenceable, Bytes); in addDereferenceableAttr()
1942 return addRawIntAttr(Attribute::DereferenceableOrNull, Bytes); in addDereferenceableOrNullAttr()
1954 return addRawIntAttr(Attribute::AllocSize, RawArgs); in addAllocSizeAttrFromRawRepr()
1967 return addRawIntAttr(Attribute::VScaleRange, RawArgs); in addVScaleRangeAttrFromRawRepr()
1973 return addRawIntAttr(Attribute::UWTable, uint64_t(Kind)); in addUWTableAttr()
1977 return addRawIntAttr(Attribute::Memory, ME.toIntValue()); in addMemoryAttr()
1984 return addRawIntAttr(Attribute::NoFPClass, Mask); in addNoFPClassAttr()
1988 return addRawIntAttr(Attribute::AllocKind, static_cast<uint64_t>(Kind)); in addAllocKindAttr()
1991 Type *AttrBuilder::getTypeAttr(Attribute::AttrKind Kind) const { in getTypeAttr()
1992 assert(Attribute::isTypeAttrKind(Kind) && "Not a type attribute"); in getTypeAttr()
1993 Attribute A = getAttribute(Kind); in getTypeAttr()
1997 AttrBuilder &AttrBuilder::addTypeAttr(Attribute::AttrKind Kind, Type *Ty) { in addTypeAttr()
1998 return addAttribute(Attribute::get(Ctx, Kind, Ty)); in addTypeAttr()
2002 return addTypeAttr(Attribute::ByVal, Ty); in addByValAttr()
2006 return addTypeAttr(Attribute::StructRet, Ty); in addStructRetAttr()
2010 return addTypeAttr(Attribute::ByRef, Ty); in addByRefAttr()
2014 return addTypeAttr(Attribute::Preallocated, Ty); in addPreallocatedAttr()
2018 return addTypeAttr(Attribute::InAlloca, Ty); in addInAllocaAttr()
2021 AttrBuilder &AttrBuilder::addConstantRangeAttr(Attribute::AttrKind Kind, in addConstantRangeAttr()
2023 return addAttribute(Attribute::get(Ctx, Kind, CR)); in addConstantRangeAttr()
2027 return addConstantRangeAttr(Attribute::Range, CR); in addRangeAttr()
2031 AttrBuilder::addConstantRangeListAttr(Attribute::AttrKind Kind, in addConstantRangeListAttr()
2033 return addAttribute(Attribute::get(Ctx, Kind, Val)); in addConstantRangeListAttr()
2037 return addConstantRangeListAttr(Attribute::Initializes, CRL.rangesRef()); in addInitializesAttr()
2049 erase_if(Attrs, [&](Attribute A) { return AM.contains(A); }); in remove()
2054 return any_of(Attrs, [&](Attribute A) { return AM.contains(A); }); in overlaps()
2057 Attribute AttrBuilder::getAttribute(Attribute::AttrKind A) const { in getAttribute()
2058 assert((unsigned)A < Attribute::EndAttrKinds && "Attribute out of range!"); in getAttribute()
2065 Attribute AttrBuilder::getAttribute(StringRef A) const { in getAttribute()
2072 bool AttrBuilder::contains(Attribute::AttrKind A) const { in contains()
2088 /// Returns true if this is a type legal for the 'nofpclass' attribute. This
2106 Incompatible.addAttribute(Attribute::AllocAlign); in typeIncompatible()
2108 Incompatible.addAttribute(Attribute::SExt).addAttribute(Attribute::ZExt); in typeIncompatible()
2114 Incompatible.addAttribute(Attribute::Range); in typeIncompatible()
2120 Incompatible.addAttribute(Attribute::NoAlias) in typeIncompatible()
2121 .addAttribute(Attribute::NoCapture) in typeIncompatible()
2122 .addAttribute(Attribute::NonNull) in typeIncompatible()
2123 .addAttribute(Attribute::ReadNone) in typeIncompatible()
2124 .addAttribute(Attribute::ReadOnly) in typeIncompatible()
2125 .addAttribute(Attribute::Dereferenceable) in typeIncompatible()
2126 .addAttribute(Attribute::DereferenceableOrNull) in typeIncompatible()
2127 .addAttribute(Attribute::Writable) in typeIncompatible()
2128 .addAttribute(Attribute::DeadOnUnwind) in typeIncompatible()
2129 .addAttribute(Attribute::Initializes); in typeIncompatible()
2131 Incompatible.addAttribute(Attribute::Nest) in typeIncompatible()
2132 .addAttribute(Attribute::SwiftError) in typeIncompatible()
2133 .addAttribute(Attribute::Preallocated) in typeIncompatible()
2134 .addAttribute(Attribute::InAlloca) in typeIncompatible()
2135 .addAttribute(Attribute::ByVal) in typeIncompatible()
2136 .addAttribute(Attribute::StructRet) in typeIncompatible()
2137 .addAttribute(Attribute::ByRef) in typeIncompatible()
2138 .addAttribute(Attribute::ElementType) in typeIncompatible()
2139 .addAttribute(Attribute::AllocatedPointer); in typeIncompatible()
2145 Incompatible.addAttribute(Attribute::Alignment); in typeIncompatible()
2150 Incompatible.addAttribute(Attribute::NoFPClass); in typeIncompatible()
2156 Incompatible.addAttribute(Attribute::NoUndef); in typeIncompatible()
2164 AM.addAttribute(Attribute::NoUndef); in getUBImplyingAttributes()
2165 AM.addAttribute(Attribute::Dereferenceable); in getUBImplyingAttributes()
2166 AM.addAttribute(Attribute::DereferenceableOrNull); in getUBImplyingAttributes()
2208 return !Callee.getAttributes().hasFnAttr(Attribute::StrictFP) || in checkStrictFP()
2209 Caller.getAttributes().hasFnAttr(Attribute::StrictFP); in checkStrictFP()
2226 /// This function sets the caller's attribute to false if the callee's attribute
2238 /// This function sets the caller's attribute to true if the callee's attribute
2251 // with Clang's -fno-stack-protector or no_stack_protector attribute), don't in adjustCallerSSPLevel()
2256 // If upgrading the SSP attribute, clear out the old SSP Attributes first. in adjustCallerSSPLevel()
2260 OldSSPAttr.addAttribute(Attribute::StackProtect) in adjustCallerSSPLevel()
2261 .addAttribute(Attribute::StackProtectStrong) in adjustCallerSSPLevel()
2262 .addAttribute(Attribute::StackProtectReq); in adjustCallerSSPLevel()
2264 if (Callee.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
2266 Caller.addFnAttr(Attribute::StackProtectReq); in adjustCallerSSPLevel()
2267 } else if (Callee.hasFnAttribute(Attribute::StackProtectStrong) && in adjustCallerSSPLevel()
2268 !Caller.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
2270 Caller.addFnAttr(Attribute::StackProtectStrong); in adjustCallerSSPLevel()
2271 } else if (Callee.hasFnAttribute(Attribute::StackProtect) && in adjustCallerSSPLevel()
2272 !Caller.hasFnAttribute(Attribute::StackProtectReq) && in adjustCallerSSPLevel()
2273 !Caller.hasFnAttribute(Attribute::StackProtectStrong)) in adjustCallerSSPLevel()
2274 Caller.addFnAttr(Attribute::StackProtect); in adjustCallerSSPLevel()
2291 Attribute CalleeAttr = Callee.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
2293 Attribute CallerAttr = Caller.getFnAttribute("stack-probe-size"); in adjustCallerStackProbeSize()
2310 /// caller has the attribute, but the callee doesn't, we need to remove the
2311 /// attribute from the caller since we can't make any guarantees about the
2314 /// to merge the attribute this way. Heuristics that would use
2319 Attribute CallerAttr = Caller.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
2321 Attribute CalleeAttr = Callee.getFnAttribute("min-legal-vector-width"); in adjustMinLegalVectorWidth()
2329 // If the callee doesn't have the attribute then we don't know anything in adjustMinLegalVectorWidth()
2330 // and must drop the attribute from the caller. in adjustMinLegalVectorWidth()
2336 /// If the inlined function has null_pointer_is_valid attribute,
2337 /// set this attribute in the caller post inlining.
2341 Caller.addFnAttr(Attribute::NullPointerIsValid); in adjustNullPointerValidAttr()
2347 Attribute::AttrKind Kind) { in isSet()
2352 Attribute::AttrKind Kind, bool Val) { in set()
2376 static enum Attribute::AttrKind getKind() { \
2377 return llvm::Attribute::ENUM_NAME; \
2419 Attribute Attr = Fn.getFnAttribute("min-legal-vector-width"); in updateMinLegalVectorWidthAttr()