1 //===-- Attributes.cpp - Implement AttributesList -------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the AttributesList class and Attribute utilities.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Attributes.h"
15 #include "LLVMContextImpl.h"
16 #include "llvm/Type.h"
17 #include "llvm/ADT/StringExtras.h"
18 #include "llvm/ADT/FoldingSet.h"
19 #include "llvm/Support/Atomic.h"
20 #include "llvm/Support/Mutex.h"
21 #include "llvm/Support/Debug.h"
22 #include "llvm/Support/ManagedStatic.h"
23 #include "llvm/Support/raw_ostream.h"
26 //===----------------------------------------------------------------------===//
27 // Attributes Implementation
28 //===----------------------------------------------------------------------===//
30 Attributes::Attributes(uint64_t Val) : Attrs(Val) {}
32 Attributes::Attributes(Attribute::AttrConst Val) : Attrs(Val.v) {}
34 Attributes::Attributes(AttributesImpl *A) : Attrs(A->Bits) {}
36 Attributes Attributes::get(LLVMContext &Context, Attributes::Builder &B) {
37 // If there are no attributes, return an empty Attributes class.
41 // Otherwise, build a key to look up the existing attributes.
42 LLVMContextImpl *pImpl = Context.pImpl;
44 ID.AddInteger(B.Bits);
47 AttributesImpl *PA = pImpl->AttrsSet.FindNodeOrInsertPos(ID, InsertPoint);
50 // If we didn't find any existing attributes of the same shape then create a
51 // new one and insert it.
52 PA = new AttributesImpl(B.Bits);
53 pImpl->AttrsSet.InsertNode(PA, InsertPoint);
56 // Return the AttributesList that we found or created.
57 return Attributes(PA);
60 bool Attributes::hasAttributes(const Attributes &A) const {
61 return Attrs.hasAttributes(A);
63 bool Attributes::hasAddressSafetyAttr() const {
64 return Attrs.hasAttribute(Attribute::AddressSafety_i);
66 bool Attributes::hasAlignmentAttr() const {
67 return Attrs.hasAttribute(Attribute::Alignment_i);
69 bool Attributes::hasAlwaysInlineAttr() const {
70 return Attrs.hasAttribute(Attribute::AlwaysInline_i);
72 bool Attributes::hasByValAttr() const {
73 return Attrs.hasAttribute(Attribute::ByVal_i);
75 bool Attributes::hasInlineHintAttr() const {
76 return Attrs.hasAttribute(Attribute::InlineHint_i);
78 bool Attributes::hasInRegAttr() const {
79 return Attrs.hasAttribute(Attribute::InReg_i);
81 bool Attributes::hasNakedAttr() const {
82 return Attrs.hasAttribute(Attribute::Naked_i);
84 bool Attributes::hasNestAttr() const {
85 return Attrs.hasAttribute(Attribute::Nest_i);
87 bool Attributes::hasNoAliasAttr() const {
88 return Attrs.hasAttribute(Attribute::NoAlias_i);
90 bool Attributes::hasNoCaptureAttr() const {
91 return Attrs.hasAttribute(Attribute::NoCapture_i);
93 bool Attributes::hasNoImplicitFloatAttr() const {
94 return Attrs.hasAttribute(Attribute::NoImplicitFloat_i);
96 bool Attributes::hasNoInlineAttr() const {
97 return Attrs.hasAttribute(Attribute::NoInline_i);
99 bool Attributes::hasNonLazyBindAttr() const {
100 return Attrs.hasAttribute(Attribute::NonLazyBind_i);
102 bool Attributes::hasNoRedZoneAttr() const {
103 return Attrs.hasAttribute(Attribute::NoRedZone_i);
105 bool Attributes::hasNoReturnAttr() const {
106 return Attrs.hasAttribute(Attribute::NoReturn_i);
108 bool Attributes::hasNoUnwindAttr() const {
109 return Attrs.hasAttribute(Attribute::NoUnwind_i);
111 bool Attributes::hasOptimizeForSizeAttr() const {
112 return Attrs.hasAttribute(Attribute::OptimizeForSize_i);
114 bool Attributes::hasReadNoneAttr() const {
115 return Attrs.hasAttribute(Attribute::ReadNone_i);
117 bool Attributes::hasReadOnlyAttr() const {
118 return Attrs.hasAttribute(Attribute::ReadOnly_i);
120 bool Attributes::hasReturnsTwiceAttr() const {
121 return Attrs.hasAttribute(Attribute::ReturnsTwice_i);
123 bool Attributes::hasSExtAttr() const {
124 return Attrs.hasAttribute(Attribute::SExt_i);
126 bool Attributes::hasStackAlignmentAttr() const {
127 return Attrs.hasAttribute(Attribute::StackAlignment_i);
129 bool Attributes::hasStackProtectAttr() const {
130 return Attrs.hasAttribute(Attribute::StackProtect_i);
132 bool Attributes::hasStackProtectReqAttr() const {
133 return Attrs.hasAttribute(Attribute::StackProtectReq_i);
135 bool Attributes::hasStructRetAttr() const {
136 return Attrs.hasAttribute(Attribute::StructRet_i);
138 bool Attributes::hasUWTableAttr() const {
139 return Attrs.hasAttribute(Attribute::UWTable_i);
141 bool Attributes::hasZExtAttr() const {
142 return Attrs.hasAttribute(Attribute::ZExt_i);
145 /// This returns the alignment field of an attribute as a byte alignment value.
146 unsigned Attributes::getAlignment() const {
147 if (!hasAlignmentAttr())
149 return 1U << ((Attrs.getAlignment() >> 16) - 1);
152 /// This returns the stack alignment field of an attribute as a byte alignment
154 unsigned Attributes::getStackAlignment() const {
155 if (!hasStackAlignmentAttr())
157 return 1U << ((Attrs.getStackAlignment() >> 26) - 1);
160 bool Attributes::isEmptyOrSingleton() const {
161 return Attrs.isEmptyOrSingleton();
164 Attributes Attributes::operator | (const Attributes &A) const {
165 return Attributes(Raw() | A.Raw());
167 Attributes Attributes::operator & (const Attributes &A) const {
168 return Attributes(Raw() & A.Raw());
170 Attributes Attributes::operator ^ (const Attributes &A) const {
171 return Attributes(Raw() ^ A.Raw());
173 Attributes &Attributes::operator |= (const Attributes &A) {
174 Attrs.Bits |= A.Raw();
177 Attributes &Attributes::operator &= (const Attributes &A) {
178 Attrs.Bits &= A.Raw();
181 Attributes Attributes::operator ~ () const {
182 return Attributes(~Raw());
185 uint64_t Attributes::Raw() const {
189 Attributes Attributes::typeIncompatible(Type *Ty) {
190 Attributes::Builder Incompatible;
192 if (!Ty->isIntegerTy()) {
193 // Attributes that only apply to integers.
194 Incompatible.addSExtAttr();
195 Incompatible.addZExtAttr();
198 if (!Ty->isPointerTy()) {
199 // Attributes that only apply to pointers.
200 Incompatible.addByValAttr();
201 Incompatible.addNestAttr();
202 Incompatible.addNoAliasAttr();
203 Incompatible.addNoCaptureAttr();
204 Incompatible.addStructRetAttr();
207 return Attributes(Incompatible.Bits); // FIXME: Use Attributes::get().
210 std::string Attributes::getAsString() const {
213 Result += "zeroext ";
215 Result += "signext ";
216 if (hasNoReturnAttr())
217 Result += "noreturn ";
218 if (hasNoUnwindAttr())
219 Result += "nounwind ";
220 if (hasUWTableAttr())
221 Result += "uwtable ";
222 if (hasReturnsTwiceAttr())
223 Result += "returns_twice ";
226 if (hasNoAliasAttr())
227 Result += "noalias ";
228 if (hasNoCaptureAttr())
229 Result += "nocapture ";
230 if (hasStructRetAttr())
236 if (hasReadNoneAttr())
237 Result += "readnone ";
238 if (hasReadOnlyAttr())
239 Result += "readonly ";
240 if (hasOptimizeForSizeAttr())
241 Result += "optsize ";
242 if (hasNoInlineAttr())
243 Result += "noinline ";
244 if (hasInlineHintAttr())
245 Result += "inlinehint ";
246 if (hasAlwaysInlineAttr())
247 Result += "alwaysinline ";
248 if (hasStackProtectAttr())
250 if (hasStackProtectReqAttr())
252 if (hasNoRedZoneAttr())
253 Result += "noredzone ";
254 if (hasNoImplicitFloatAttr())
255 Result += "noimplicitfloat ";
258 if (hasNonLazyBindAttr())
259 Result += "nonlazybind ";
260 if (hasAddressSafetyAttr())
261 Result += "address_safety ";
262 if (hasStackAlignmentAttr()) {
263 Result += "alignstack(";
264 Result += utostr(getStackAlignment());
267 if (hasAlignmentAttr()) {
269 Result += utostr(getAlignment());
272 // Trim the trailing space.
273 assert(!Result.empty() && "Unknown attribute!");
274 Result.erase(Result.end()-1);
278 //===----------------------------------------------------------------------===//
279 // Attributes::Builder Implementation
280 //===----------------------------------------------------------------------===//
282 void Attributes::Builder::addAddressSafetyAttr() {
283 Bits |= Attribute::AddressSafety_i;
285 void Attributes::Builder::addAlwaysInlineAttr() {
286 Bits |= Attribute::AlwaysInline_i;
288 void Attributes::Builder::addByValAttr() {
289 Bits |= Attribute::ByVal_i;
291 void Attributes::Builder::addInlineHintAttr() {
292 Bits |= Attribute::InlineHint_i;
294 void Attributes::Builder::addInRegAttr() {
295 Bits |= Attribute::InReg_i;
297 void Attributes::Builder::addNakedAttr() {
298 Bits |= Attribute::Naked_i;
300 void Attributes::Builder::addNestAttr() {
301 Bits |= Attribute::Nest_i;
303 void Attributes::Builder::addNoAliasAttr() {
304 Bits |= Attribute::NoAlias_i;
306 void Attributes::Builder::addNoCaptureAttr() {
307 Bits |= Attribute::NoCapture_i;
309 void Attributes::Builder::addNoImplicitFloatAttr() {
310 Bits |= Attribute::NoImplicitFloat_i;
312 void Attributes::Builder::addNoInlineAttr() {
313 Bits |= Attribute::NoInline_i;
315 void Attributes::Builder::addNonLazyBindAttr() {
316 Bits |= Attribute::NonLazyBind_i;
318 void Attributes::Builder::addNoRedZoneAttr() {
319 Bits |= Attribute::NoRedZone_i;
321 void Attributes::Builder::addNoReturnAttr() {
322 Bits |= Attribute::NoReturn_i;
324 void Attributes::Builder::addNoUnwindAttr() {
325 Bits |= Attribute::NoUnwind_i;
327 void Attributes::Builder::addOptimizeForSizeAttr() {
328 Bits |= Attribute::OptimizeForSize_i;
330 void Attributes::Builder::addReadNoneAttr() {
331 Bits |= Attribute::ReadNone_i;
333 void Attributes::Builder::addReadOnlyAttr() {
334 Bits |= Attribute::ReadOnly_i;
336 void Attributes::Builder::addReturnsTwiceAttr() {
337 Bits |= Attribute::ReturnsTwice_i;
339 void Attributes::Builder::addSExtAttr() {
340 Bits |= Attribute::SExt_i;
342 void Attributes::Builder::addStackProtectAttr() {
343 Bits |= Attribute::StackProtect_i;
345 void Attributes::Builder::addStackProtectReqAttr() {
346 Bits |= Attribute::StackProtectReq_i;
348 void Attributes::Builder::addStructRetAttr() {
349 Bits |= Attribute::StructRet_i;
351 void Attributes::Builder::addUWTableAttr() {
352 Bits |= Attribute::UWTable_i;
354 void Attributes::Builder::addZExtAttr() {
355 Bits |= Attribute::ZExt_i;
358 void Attributes::Builder::addAlignmentAttr(unsigned Align) {
359 if (Align == 0) return;
360 assert(isPowerOf2_32(Align) && "Alignment must be a power of two.");
361 assert(Align <= 0x40000000 && "Alignment too large.");
362 Bits |= (Log2_32(Align) + 1) << 16;
364 void Attributes::Builder::addStackAlignmentAttr(unsigned Align) {
365 // Default alignment, allow the target to define how to align it.
366 if (Align == 0) return;
367 assert(isPowerOf2_32(Align) && "Alignment must be a power of two.");
368 assert(Align <= 0x100 && "Alignment too large.");
369 Bits |= (Log2_32(Align) + 1) << 26;
372 void Attributes::Builder::removeAddressSafetyAttr() {
373 Bits &= ~Attribute::AddressSafety_i;
375 void Attributes::Builder::removeAlwaysInlineAttr() {
376 Bits &= ~Attribute::AlwaysInline_i;
378 void Attributes::Builder::removeByValAttr() {
379 Bits &= ~Attribute::ByVal_i;
381 void Attributes::Builder::removeInlineHintAttr() {
382 Bits &= ~Attribute::InlineHint_i;
384 void Attributes::Builder::removeInRegAttr() {
385 Bits &= ~Attribute::InReg_i;
387 void Attributes::Builder::removeNakedAttr() {
388 Bits &= ~Attribute::Naked_i;
390 void Attributes::Builder::removeNestAttr() {
391 Bits &= ~Attribute::Nest_i;
393 void Attributes::Builder::removeNoAliasAttr() {
394 Bits &= ~Attribute::NoAlias_i;
396 void Attributes::Builder::removeNoCaptureAttr() {
397 Bits &= ~Attribute::NoCapture_i;
399 void Attributes::Builder::removeNoImplicitFloatAttr() {
400 Bits &= ~Attribute::NoImplicitFloat_i;
402 void Attributes::Builder::removeNoInlineAttr() {
403 Bits &= ~Attribute::NoInline_i;
405 void Attributes::Builder::removeNonLazyBindAttr() {
406 Bits &= ~Attribute::NonLazyBind_i;
408 void Attributes::Builder::removeNoRedZoneAttr() {
409 Bits &= ~Attribute::NoRedZone_i;
411 void Attributes::Builder::removeNoReturnAttr() {
412 Bits &= ~Attribute::NoReturn_i;
414 void Attributes::Builder::removeNoUnwindAttr() {
415 Bits &= ~Attribute::NoUnwind_i;
417 void Attributes::Builder::removeOptimizeForSizeAttr() {
418 Bits &= ~Attribute::OptimizeForSize_i;
420 void Attributes::Builder::removeReadNoneAttr() {
421 Bits &= ~Attribute::ReadNone_i;
423 void Attributes::Builder::removeReadOnlyAttr() {
424 Bits &= ~Attribute::ReadOnly_i;
426 void Attributes::Builder::removeReturnsTwiceAttr() {
427 Bits &= ~Attribute::ReturnsTwice_i;
429 void Attributes::Builder::removeSExtAttr() {
430 Bits &= ~Attribute::SExt_i;
432 void Attributes::Builder::removeStackProtectAttr() {
433 Bits &= ~Attribute::StackProtect_i;
435 void Attributes::Builder::removeStackProtectReqAttr() {
436 Bits &= ~Attribute::StackProtectReq_i;
438 void Attributes::Builder::removeStructRetAttr() {
439 Bits &= ~Attribute::StructRet_i;
441 void Attributes::Builder::removeUWTableAttr() {
442 Bits &= ~Attribute::UWTable_i;
444 void Attributes::Builder::removeZExtAttr() {
445 Bits &= ~Attribute::ZExt_i;
448 //===----------------------------------------------------------------------===//
449 // AttributeImpl Definition
450 //===----------------------------------------------------------------------===//
452 bool AttributesImpl::hasAttribute(uint64_t A) const {
453 return (Bits & A) != 0;
456 bool AttributesImpl::hasAttributes() const {
460 bool AttributesImpl::hasAttributes(const Attributes &A) const {
461 return Bits & A.Raw(); // FIXME: Raw() won't work here in the future.
464 uint64_t AttributesImpl::getAlignment() const {
465 return Bits & Attribute::Alignment_i;
468 uint64_t AttributesImpl::getStackAlignment() const {
469 return Bits & Attribute::StackAlignment_i;
472 bool AttributesImpl::isEmptyOrSingleton() const {
473 return (Bits & (Bits - 1)) == 0;
476 //===----------------------------------------------------------------------===//
477 // AttributeListImpl Definition
478 //===----------------------------------------------------------------------===//
481 class AttributeListImpl;
484 static ManagedStatic<FoldingSet<AttributeListImpl> > AttributesLists;
487 static ManagedStatic<sys::SmartMutex<true> > ALMutex;
489 class AttributeListImpl : public FoldingSetNode {
490 sys::cas_flag RefCount;
492 // AttributesList is uniqued, these should not be publicly available.
493 void operator=(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
494 AttributeListImpl(const AttributeListImpl &) LLVM_DELETED_FUNCTION;
495 ~AttributeListImpl(); // Private implementation
497 SmallVector<AttributeWithIndex, 4> Attrs;
499 AttributeListImpl(ArrayRef<AttributeWithIndex> attrs)
500 : Attrs(attrs.begin(), attrs.end()) {
505 sys::SmartScopedLock<true> Lock(*ALMutex);
509 sys::SmartScopedLock<true> Lock(*ALMutex);
510 if (!AttributesLists.isConstructed())
512 sys::cas_flag new_val = --RefCount;
517 void Profile(FoldingSetNodeID &ID) const {
520 static void Profile(FoldingSetNodeID &ID, ArrayRef<AttributeWithIndex> Attrs){
521 for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
522 ID.AddInteger(Attrs[i].Attrs.Raw());
523 ID.AddInteger(Attrs[i].Index);
529 AttributeListImpl::~AttributeListImpl() {
530 // NOTE: Lock must be acquired by caller.
531 AttributesLists->RemoveNode(this);
535 AttrListPtr AttrListPtr::get(ArrayRef<AttributeWithIndex> Attrs) {
536 // If there are no attributes then return a null AttributesList pointer.
538 return AttrListPtr();
541 for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
542 assert(Attrs[i].Attrs.hasAttributes() &&
543 "Pointless attribute!");
544 assert((!i || Attrs[i-1].Index < Attrs[i].Index) &&
545 "Misordered AttributesList!");
549 // Otherwise, build a key to look up the existing attributes.
551 AttributeListImpl::Profile(ID, Attrs);
554 sys::SmartScopedLock<true> Lock(*ALMutex);
556 AttributeListImpl *PAL =
557 AttributesLists->FindNodeOrInsertPos(ID, InsertPos);
559 // If we didn't find any existing attributes of the same shape then
560 // create a new one and insert it.
562 PAL = new AttributeListImpl(Attrs);
563 AttributesLists->InsertNode(PAL, InsertPos);
566 // Return the AttributesList that we found or created.
567 return AttrListPtr(PAL);
571 //===----------------------------------------------------------------------===//
572 // AttrListPtr Method Implementations
573 //===----------------------------------------------------------------------===//
575 AttrListPtr::AttrListPtr(AttributeListImpl *LI) : AttrList(LI) {
576 if (LI) LI->AddRef();
579 AttrListPtr::AttrListPtr(const AttrListPtr &P) : AttrList(P.AttrList) {
580 if (AttrList) AttrList->AddRef();
583 const AttrListPtr &AttrListPtr::operator=(const AttrListPtr &RHS) {
584 sys::SmartScopedLock<true> Lock(*ALMutex);
585 if (AttrList == RHS.AttrList) return *this;
586 if (AttrList) AttrList->DropRef();
587 AttrList = RHS.AttrList;
588 if (AttrList) AttrList->AddRef();
592 AttrListPtr::~AttrListPtr() {
593 if (AttrList) AttrList->DropRef();
596 /// getNumSlots - Return the number of slots used in this attribute list.
597 /// This is the number of arguments that have an attribute set on them
598 /// (including the function itself).
599 unsigned AttrListPtr::getNumSlots() const {
600 return AttrList ? AttrList->Attrs.size() : 0;
603 /// getSlot - Return the AttributeWithIndex at the specified slot. This
604 /// holds a number plus a set of attributes.
605 const AttributeWithIndex &AttrListPtr::getSlot(unsigned Slot) const {
606 assert(AttrList && Slot < AttrList->Attrs.size() && "Slot # out of range!");
607 return AttrList->Attrs[Slot];
611 /// getAttributes - The attributes for the specified index are
612 /// returned. Attributes for the result are denoted with Idx = 0.
613 /// Function notes are denoted with idx = ~0.
614 Attributes AttrListPtr::getAttributes(unsigned Idx) const {
615 if (AttrList == 0) return Attributes();
617 const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs;
618 for (unsigned i = 0, e = Attrs.size(); i != e && Attrs[i].Index <= Idx; ++i)
619 if (Attrs[i].Index == Idx)
620 return Attrs[i].Attrs;
625 /// hasAttrSomewhere - Return true if the specified attribute is set for at
626 /// least one parameter or for the return value.
627 bool AttrListPtr::hasAttrSomewhere(Attributes Attr) const {
628 if (AttrList == 0) return false;
630 const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs;
631 for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
632 if (Attrs[i].Attrs.hasAttributes(Attr))
638 AttrListPtr AttrListPtr::addAttr(unsigned Idx, Attributes Attrs) const {
639 Attributes OldAttrs = getAttributes(Idx);
641 // FIXME it is not obvious how this should work for alignment.
642 // For now, say we can't change a known alignment.
643 unsigned OldAlign = OldAttrs.getAlignment();
644 unsigned NewAlign = Attrs.getAlignment();
645 assert((!OldAlign || !NewAlign || OldAlign == NewAlign) &&
646 "Attempt to change alignment!");
649 Attributes NewAttrs = OldAttrs | Attrs;
650 if (NewAttrs == OldAttrs)
653 SmallVector<AttributeWithIndex, 8> NewAttrList;
655 NewAttrList.push_back(AttributeWithIndex::get(Idx, Attrs));
657 const SmallVector<AttributeWithIndex, 4> &OldAttrList = AttrList->Attrs;
658 unsigned i = 0, e = OldAttrList.size();
659 // Copy attributes for arguments before this one.
660 for (; i != e && OldAttrList[i].Index < Idx; ++i)
661 NewAttrList.push_back(OldAttrList[i]);
663 // If there are attributes already at this index, merge them in.
664 if (i != e && OldAttrList[i].Index == Idx) {
665 Attrs |= OldAttrList[i].Attrs;
669 NewAttrList.push_back(AttributeWithIndex::get(Idx, Attrs));
671 // Copy attributes for arguments after this one.
672 NewAttrList.insert(NewAttrList.end(),
673 OldAttrList.begin()+i, OldAttrList.end());
676 return get(NewAttrList);
679 AttrListPtr AttrListPtr::removeAttr(unsigned Idx, Attributes Attrs) const {
681 // FIXME it is not obvious how this should work for alignment.
682 // For now, say we can't pass in alignment, which no current use does.
683 assert(!Attrs.hasAlignmentAttr() && "Attempt to exclude alignment!");
685 if (AttrList == 0) return AttrListPtr();
687 Attributes OldAttrs = getAttributes(Idx);
688 Attributes NewAttrs = OldAttrs & ~Attrs;
689 if (NewAttrs == OldAttrs)
692 SmallVector<AttributeWithIndex, 8> NewAttrList;
693 const SmallVector<AttributeWithIndex, 4> &OldAttrList = AttrList->Attrs;
694 unsigned i = 0, e = OldAttrList.size();
696 // Copy attributes for arguments before this one.
697 for (; i != e && OldAttrList[i].Index < Idx; ++i)
698 NewAttrList.push_back(OldAttrList[i]);
700 // If there are attributes already at this index, merge them in.
701 assert(OldAttrList[i].Index == Idx && "Attribute isn't set?");
702 Attrs = OldAttrList[i].Attrs & ~Attrs;
704 if (Attrs) // If any attributes left for this parameter, add them.
705 NewAttrList.push_back(AttributeWithIndex::get(Idx, Attrs));
707 // Copy attributes for arguments after this one.
708 NewAttrList.insert(NewAttrList.end(),
709 OldAttrList.begin()+i, OldAttrList.end());
711 return get(NewAttrList);
714 void AttrListPtr::dump() const {
716 for (unsigned i = 0; i < getNumSlots(); ++i) {
717 const AttributeWithIndex &PAWI = getSlot(i);
718 dbgs() << "{" << PAWI.Index << "," << PAWI.Attrs << "} ";