• Home
  • Raw
  • Download

Lines Matching refs:Attribute

64 Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind,  in get()
85 return Attribute(PA); in get()
88 Attribute Attribute::get(LLVMContext &Context, StringRef Kind, StringRef Val) { in get()
105 return Attribute(PA); in get()
108 Attribute Attribute::getWithAlignment(LLVMContext &Context, uint64_t Align) { in getWithAlignment()
114 Attribute Attribute::getWithStackAlignment(LLVMContext &Context, in getWithStackAlignment()
121 Attribute Attribute::getWithDereferenceableBytes(LLVMContext &Context, in getWithDereferenceableBytes()
127 Attribute Attribute::getWithDereferenceableOrNullBytes(LLVMContext &Context, in getWithDereferenceableOrNullBytes()
133 Attribute
134 Attribute::getWithAllocSizeArgs(LLVMContext &Context, unsigned ElemSizeArg, in getWithAllocSizeArgs()
145 bool Attribute::isEnumAttribute() const { in isEnumAttribute()
149 bool Attribute::isIntAttribute() const { in isIntAttribute()
153 bool Attribute::isStringAttribute() const { in isStringAttribute()
157 Attribute::AttrKind Attribute::getKindAsEnum() const { in getKindAsEnum()
164 uint64_t Attribute::getValueAsInt() const { in getValueAsInt()
171 StringRef Attribute::getKindAsString() const { in getKindAsString()
178 StringRef Attribute::getValueAsString() const { in getValueAsString()
185 bool Attribute::hasAttribute(AttrKind Kind) const { in hasAttribute()
189 bool Attribute::hasAttribute(StringRef Kind) const { in hasAttribute()
194 unsigned Attribute::getAlignment() const { in getAlignment()
195 assert(hasAttribute(Attribute::Alignment) && in getAlignment()
200 unsigned Attribute::getStackAlignment() const { in getStackAlignment()
201 assert(hasAttribute(Attribute::StackAlignment) && in getStackAlignment()
206 uint64_t Attribute::getDereferenceableBytes() const { in getDereferenceableBytes()
207 assert(hasAttribute(Attribute::Dereferenceable) && in getDereferenceableBytes()
213 uint64_t Attribute::getDereferenceableOrNullBytes() const { in getDereferenceableOrNullBytes()
214 assert(hasAttribute(Attribute::DereferenceableOrNull) && in getDereferenceableOrNullBytes()
220 std::pair<unsigned, Optional<unsigned>> Attribute::getAllocSizeArgs() const { in getAllocSizeArgs()
221 assert(hasAttribute(Attribute::AllocSize) && in getAllocSizeArgs()
226 std::string Attribute::getAsString(bool InAttrGrp) const { in getAsString()
229 if (hasAttribute(Attribute::SanitizeAddress)) in getAsString()
231 if (hasAttribute(Attribute::AlwaysInline)) in getAsString()
233 if (hasAttribute(Attribute::ArgMemOnly)) in getAsString()
235 if (hasAttribute(Attribute::Builtin)) in getAsString()
237 if (hasAttribute(Attribute::ByVal)) in getAsString()
239 if (hasAttribute(Attribute::Convergent)) in getAsString()
241 if (hasAttribute(Attribute::SwiftError)) in getAsString()
243 if (hasAttribute(Attribute::SwiftSelf)) in getAsString()
245 if (hasAttribute(Attribute::InaccessibleMemOnly)) in getAsString()
247 if (hasAttribute(Attribute::InaccessibleMemOrArgMemOnly)) in getAsString()
249 if (hasAttribute(Attribute::InAlloca)) in getAsString()
251 if (hasAttribute(Attribute::InlineHint)) in getAsString()
253 if (hasAttribute(Attribute::InReg)) in getAsString()
255 if (hasAttribute(Attribute::JumpTable)) in getAsString()
257 if (hasAttribute(Attribute::MinSize)) in getAsString()
259 if (hasAttribute(Attribute::Naked)) in getAsString()
261 if (hasAttribute(Attribute::Nest)) in getAsString()
263 if (hasAttribute(Attribute::NoAlias)) in getAsString()
265 if (hasAttribute(Attribute::NoBuiltin)) in getAsString()
267 if (hasAttribute(Attribute::NoCapture)) in getAsString()
269 if (hasAttribute(Attribute::NoDuplicate)) in getAsString()
271 if (hasAttribute(Attribute::NoImplicitFloat)) in getAsString()
273 if (hasAttribute(Attribute::NoInline)) in getAsString()
275 if (hasAttribute(Attribute::NonLazyBind)) in getAsString()
277 if (hasAttribute(Attribute::NonNull)) in getAsString()
279 if (hasAttribute(Attribute::NoRedZone)) in getAsString()
281 if (hasAttribute(Attribute::NoReturn)) in getAsString()
283 if (hasAttribute(Attribute::NoRecurse)) in getAsString()
285 if (hasAttribute(Attribute::NoUnwind)) in getAsString()
287 if (hasAttribute(Attribute::OptimizeNone)) in getAsString()
289 if (hasAttribute(Attribute::OptimizeForSize)) in getAsString()
291 if (hasAttribute(Attribute::ReadNone)) in getAsString()
293 if (hasAttribute(Attribute::ReadOnly)) in getAsString()
295 if (hasAttribute(Attribute::WriteOnly)) in getAsString()
297 if (hasAttribute(Attribute::Returned)) in getAsString()
299 if (hasAttribute(Attribute::ReturnsTwice)) in getAsString()
301 if (hasAttribute(Attribute::SExt)) in getAsString()
303 if (hasAttribute(Attribute::StackProtect)) in getAsString()
305 if (hasAttribute(Attribute::StackProtectReq)) in getAsString()
307 if (hasAttribute(Attribute::StackProtectStrong)) in getAsString()
309 if (hasAttribute(Attribute::SafeStack)) in getAsString()
311 if (hasAttribute(Attribute::StructRet)) in getAsString()
313 if (hasAttribute(Attribute::SanitizeThread)) in getAsString()
315 if (hasAttribute(Attribute::SanitizeMemory)) in getAsString()
317 if (hasAttribute(Attribute::UWTable)) in getAsString()
319 if (hasAttribute(Attribute::ZExt)) in getAsString()
321 if (hasAttribute(Attribute::Cold)) in getAsString()
329 if (hasAttribute(Attribute::Alignment)) { in getAsString()
351 if (hasAttribute(Attribute::StackAlignment)) in getAsString()
354 if (hasAttribute(Attribute::Dereferenceable)) in getAsString()
357 if (hasAttribute(Attribute::DereferenceableOrNull)) in getAsString()
360 if (hasAttribute(Attribute::AllocSize)) { in getAsString()
394 bool Attribute::operator<(Attribute A) const { in operator <()
411 bool AttributeImpl::hasAttribute(Attribute::AttrKind A) const { in hasAttribute()
421 Attribute::AttrKind AttributeImpl::getKindAsEnum() const { in getKindAsEnum()
467 uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) { in getAttrMask()
470 case Attribute::EndAttrKinds: in getAttrMask()
473 case Attribute::None: return 0; in getAttrMask()
474 case Attribute::ZExt: return 1 << 0; in getAttrMask()
475 case Attribute::SExt: return 1 << 1; in getAttrMask()
476 case Attribute::NoReturn: return 1 << 2; in getAttrMask()
477 case Attribute::InReg: return 1 << 3; in getAttrMask()
478 case Attribute::StructRet: return 1 << 4; in getAttrMask()
479 case Attribute::NoUnwind: return 1 << 5; in getAttrMask()
480 case Attribute::NoAlias: return 1 << 6; in getAttrMask()
481 case Attribute::ByVal: return 1 << 7; in getAttrMask()
482 case Attribute::Nest: return 1 << 8; in getAttrMask()
483 case Attribute::ReadNone: return 1 << 9; in getAttrMask()
484 case Attribute::ReadOnly: return 1 << 10; in getAttrMask()
485 case Attribute::NoInline: return 1 << 11; in getAttrMask()
486 case Attribute::AlwaysInline: return 1 << 12; in getAttrMask()
487 case Attribute::OptimizeForSize: return 1 << 13; in getAttrMask()
488 case Attribute::StackProtect: return 1 << 14; in getAttrMask()
489 case Attribute::StackProtectReq: return 1 << 15; in getAttrMask()
490 case Attribute::Alignment: return 31 << 16; in getAttrMask()
491 case Attribute::NoCapture: return 1 << 21; in getAttrMask()
492 case Attribute::NoRedZone: return 1 << 22; in getAttrMask()
493 case Attribute::NoImplicitFloat: return 1 << 23; in getAttrMask()
494 case Attribute::Naked: return 1 << 24; in getAttrMask()
495 case Attribute::InlineHint: return 1 << 25; in getAttrMask()
496 case Attribute::StackAlignment: return 7 << 26; in getAttrMask()
497 case Attribute::ReturnsTwice: return 1 << 29; in getAttrMask()
498 case Attribute::UWTable: return 1 << 30; in getAttrMask()
499 case Attribute::NonLazyBind: return 1U << 31; in getAttrMask()
500 case Attribute::SanitizeAddress: return 1ULL << 32; in getAttrMask()
501 case Attribute::MinSize: return 1ULL << 33; in getAttrMask()
502 case Attribute::NoDuplicate: return 1ULL << 34; in getAttrMask()
503 case Attribute::StackProtectStrong: return 1ULL << 35; in getAttrMask()
504 case Attribute::SanitizeThread: return 1ULL << 36; in getAttrMask()
505 case Attribute::SanitizeMemory: return 1ULL << 37; in getAttrMask()
506 case Attribute::NoBuiltin: return 1ULL << 38; in getAttrMask()
507 case Attribute::Returned: return 1ULL << 39; in getAttrMask()
508 case Attribute::Cold: return 1ULL << 40; in getAttrMask()
509 case Attribute::Builtin: return 1ULL << 41; in getAttrMask()
510 case Attribute::OptimizeNone: return 1ULL << 42; in getAttrMask()
511 case Attribute::InAlloca: return 1ULL << 43; in getAttrMask()
512 case Attribute::NonNull: return 1ULL << 44; in getAttrMask()
513 case Attribute::JumpTable: return 1ULL << 45; in getAttrMask()
514 case Attribute::Convergent: return 1ULL << 46; in getAttrMask()
515 case Attribute::SafeStack: return 1ULL << 47; in getAttrMask()
516 case Attribute::NoRecurse: return 1ULL << 48; in getAttrMask()
517 case Attribute::InaccessibleMemOnly: return 1ULL << 49; in getAttrMask()
518 case Attribute::InaccessibleMemOrArgMemOnly: return 1ULL << 50; in getAttrMask()
519 case Attribute::SwiftSelf: return 1ULL << 51; in getAttrMask()
520 case Attribute::SwiftError: return 1ULL << 52; in getAttrMask()
521 case Attribute::WriteOnly: return 1ULL << 53; in getAttrMask()
522 case Attribute::Dereferenceable: in getAttrMask()
525 case Attribute::DereferenceableOrNull: in getAttrMask()
529 case Attribute::ArgMemOnly: in getAttrMask()
532 case Attribute::AllocSize: in getAttrMask()
544 ArrayRef<Attribute> Attrs) { in get()
552 SmallVector<Attribute, 8> SortedAttrs(Attrs.begin(), Attrs.end()); in get()
555 for (Attribute Attr : SortedAttrs) in get()
566 void *Mem = ::operator new(totalSizeToAlloc<Attribute>(SortedAttrs.size())); in get()
576 for (Attribute I : *this) in hasAttribute()
582 Attribute AttributeSetNode::getAttribute(Attribute::AttrKind Kind) const { in getAttribute()
584 for (Attribute I : *this) in getAttribute()
588 return Attribute(); in getAttribute()
591 Attribute AttributeSetNode::getAttribute(StringRef Kind) const { in getAttribute()
592 for (Attribute I : *this) in getAttribute()
595 return Attribute(); in getAttribute()
599 for (Attribute I : *this) in getAlignment()
600 if (I.hasAttribute(Attribute::Alignment)) in getAlignment()
606 for (Attribute I : *this) in getStackAlignment()
607 if (I.hasAttribute(Attribute::StackAlignment)) in getStackAlignment()
613 for (Attribute I : *this) in getDereferenceableBytes()
614 if (I.hasAttribute(Attribute::Dereferenceable)) in getDereferenceableBytes()
620 for (Attribute I : *this) in getDereferenceableOrNullBytes()
621 if (I.hasAttribute(Attribute::DereferenceableOrNull)) in getDereferenceableOrNullBytes()
628 for (Attribute I : *this) in getAllocSizeArgs()
629 if (I.hasAttribute(Attribute::AllocSize)) in getAllocSizeArgs()
656 Attribute Attr = *II; in Raw()
661 Attribute::AttrKind Kind = Attr.getKindAsEnum(); in Raw()
663 if (Kind == Attribute::Alignment) in Raw()
665 else if (Kind == Attribute::StackAlignment) in Raw()
667 else if (Kind == Attribute::Dereferenceable) in Raw()
669 else if (Kind == Attribute::AllocSize) in Raw()
714 ArrayRef<std::pair<unsigned, Attribute> > Attrs){ in get()
720 [](const std::pair<unsigned, Attribute> &LHS, in get()
721 const std::pair<unsigned, Attribute> &RHS) { in get()
725 [](const std::pair<unsigned, Attribute> &Pair) { in get()
726 return Pair.second.hasAttribute(Attribute::None); in get()
732 for (ArrayRef<std::pair<unsigned, Attribute> >::iterator I = Attrs.begin(), in get()
735 SmallVector<Attribute, 4> AttrVec; in get()
764 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
765 for (Attribute::AttrKind Kind = Attribute::None; in get()
766 Kind != Attribute::EndAttrKinds; Kind = Attribute::AttrKind(Kind + 1)) { in get()
770 Attribute Attr; in get()
772 case Attribute::Alignment: in get()
773 Attr = Attribute::getWithAlignment(C, B.getAlignment()); in get()
775 case Attribute::StackAlignment: in get()
776 Attr = Attribute::getWithStackAlignment(C, B.getStackAlignment()); in get()
778 case Attribute::Dereferenceable: in get()
779 Attr = Attribute::getWithDereferenceableBytes( in get()
782 case Attribute::DereferenceableOrNull: in get()
783 Attr = Attribute::getWithDereferenceableOrNullBytes( in get()
786 case Attribute::AllocSize: { in get()
788 Attr = Attribute::getWithAllocSizeArgs(C, A.first, A.second); in get()
792 Attr = Attribute::get(C, Kind); in get()
800 std::make_pair(Index, Attribute::get(C, TDA.first, TDA.second))); in get()
806 ArrayRef<Attribute::AttrKind> Kinds) { in get()
807 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
808 for (Attribute::AttrKind K : Kinds) in get()
809 Attrs.push_back(std::make_pair(Index, Attribute::get(C, K))); in get()
815 SmallVector<std::pair<unsigned, Attribute>, 8> Attrs; in get()
817 Attrs.push_back(std::make_pair(Index, Attribute::get(C, K))); in get()
852 Attribute::AttrKind Kind) const { in addAttribute()
866 Attribute A) const { in addAttribute()
944 Attribute::AttrKind Kind) const { in removeAttribute()
962 assert(!Attrs.hasAttribute(Index, Attribute::Alignment) && in removeAttributes()
1092 bool AttributeSet::hasAttribute(unsigned Index, Attribute::AttrKind Kind) const{ in hasAttribute()
1107 bool AttributeSet::hasFnAttribute(Attribute::AttrKind Kind) const { in hasFnAttribute()
1111 bool AttributeSet::hasAttrSomewhere(Attribute::AttrKind Attr, in hasAttrSomewhere()
1126 Attribute AttributeSet::getAttribute(unsigned Index, in getAttribute()
1127 Attribute::AttrKind Kind) const { in getAttribute()
1129 return ASN ? ASN->getAttribute(Kind) : Attribute(); in getAttribute()
1132 Attribute AttributeSet::getAttribute(unsigned Index, in getAttribute()
1135 return ASN ? ASN->getAttribute(Kind) : Attribute(); in getAttribute()
1182 return ArrayRef<Attribute>().begin(); in begin()
1188 return ArrayRef<Attribute>().end(); in end()
1261 AttrBuilder &AttrBuilder::addAttribute(Attribute::AttrKind Val) { in addAttribute()
1262 assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!"); in addAttribute()
1263 assert(Val != Attribute::Alignment && Val != Attribute::StackAlignment && in addAttribute()
1264 Val != Attribute::Dereferenceable && Val != Attribute::AllocSize && in addAttribute()
1270 AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { in addAttribute()
1276 Attribute::AttrKind Kind = Attr.getKindAsEnum(); in addAttribute()
1279 if (Kind == Attribute::Alignment) in addAttribute()
1281 else if (Kind == Attribute::StackAlignment) in addAttribute()
1283 else if (Kind == Attribute::Dereferenceable) in addAttribute()
1285 else if (Kind == Attribute::DereferenceableOrNull) in addAttribute()
1287 else if (Kind == Attribute::AllocSize) in addAttribute()
1297 AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) { in removeAttribute()
1298 assert((unsigned)Val < Attribute::EndAttrKinds && "Attribute out of range!"); in removeAttribute()
1301 if (Val == Attribute::Alignment) in removeAttribute()
1303 else if (Val == Attribute::StackAlignment) in removeAttribute()
1305 else if (Val == Attribute::Dereferenceable) in removeAttribute()
1307 else if (Val == Attribute::DereferenceableOrNull) in removeAttribute()
1309 else if (Val == Attribute::AllocSize) in removeAttribute()
1326 Attribute Attr = *I; in removeAttributes()
1355 Attrs[Attribute::Alignment] = true; in addAlignmentAttr()
1367 Attrs[Attribute::StackAlignment] = true; in addStackAlignmentAttr()
1375 Attrs[Attribute::Dereferenceable] = true; in addDereferenceableAttr()
1384 Attrs[Attribute::DereferenceableOrNull] = true; in addDereferenceableOrNullAttr()
1398 Attrs[Attribute::AllocSize] = true; in addAllocSizeAttrFromRawRepr()
1487 Attribute Attr = *I; in hasAttributes()
1521 for (Attribute::AttrKind I = Attribute::None; I != Attribute::EndAttrKinds; in addRawValue()
1522 I = Attribute::AttrKind(I + 1)) { in addRawValue()
1523 if (I == Attribute::Dereferenceable || in addRawValue()
1524 I == Attribute::DereferenceableOrNull || in addRawValue()
1525 I == Attribute::ArgMemOnly || in addRawValue()
1526 I == Attribute::AllocSize) in addRawValue()
1531 if (I == Attribute::Alignment) in addRawValue()
1533 else if (I == Attribute::StackAlignment) in addRawValue()
1551 Incompatible.addAttribute(Attribute::SExt) in typeIncompatible()
1552 .addAttribute(Attribute::ZExt); in typeIncompatible()
1556 Incompatible.addAttribute(Attribute::ByVal) in typeIncompatible()
1557 .addAttribute(Attribute::Nest) in typeIncompatible()
1558 .addAttribute(Attribute::NoAlias) in typeIncompatible()
1559 .addAttribute(Attribute::NoCapture) in typeIncompatible()
1560 .addAttribute(Attribute::NonNull) in typeIncompatible()
1563 .addAttribute(Attribute::ReadNone) in typeIncompatible()
1564 .addAttribute(Attribute::ReadOnly) in typeIncompatible()
1565 .addAttribute(Attribute::StructRet) in typeIncompatible()
1566 .addAttribute(Attribute::InAlloca); in typeIncompatible()
1608 B.addAttribute(Attribute::StackProtect) in adjustCallerSSPLevel()
1609 .addAttribute(Attribute::StackProtectStrong) in adjustCallerSSPLevel()
1610 .addAttribute(Attribute::StackProtectReq); in adjustCallerSSPLevel()
1615 if (Callee.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
1617 Caller.addFnAttr(Attribute::StackProtectReq); in adjustCallerSSPLevel()
1618 } else if (Callee.hasFnAttribute(Attribute::StackProtectStrong) && in adjustCallerSSPLevel()
1619 !Caller.hasFnAttribute(Attribute::StackProtectReq)) { in adjustCallerSSPLevel()
1621 Caller.addFnAttr(Attribute::StackProtectStrong); in adjustCallerSSPLevel()
1622 } else if (Callee.hasFnAttribute(Attribute::StackProtect) && in adjustCallerSSPLevel()
1623 !Caller.hasFnAttribute(Attribute::StackProtectReq) && in adjustCallerSSPLevel()
1624 !Caller.hasFnAttribute(Attribute::StackProtectStrong)) in adjustCallerSSPLevel()
1625 Caller.addFnAttr(Attribute::StackProtect); in adjustCallerSSPLevel()