llvm.org GIT mirror llvm / 4a6fc8b
Kill deprecated attribute API Summary: This kill various depreacated API related to attribute : - The deprecated C API attribute based on LLVMAttribute enum. - The Raw attribute set format (planned to be removed in 4.0). Reviewers: bkramer, echristo, mehdi_amini, void Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23039 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286062 91177308-0d34-0410-b5e6-96231b3b80d8 Amaury Sechet 2 years ago
7 changed file(s) with 100 addition(s) and 302 deletion(s). Raw diff Collapse all Expand all
3232
3333 Non-comprehensive list of changes in this release
3434 =================================================
35 * The C API functions LLVMAddFunctionAttr, LLVMGetFunctionAttr,
36 LLVMRemoveFunctionAttr, LLVMAddAttribute, LLVMRemoveAttribute,
37 LLVMGetAttribute, LLVMAddInstrAttribute and
38 LLVMRemoveInstrAttribute have been removed.
39
40 * The C API enum LLVMAttribute has been deleted.
3541
3642 .. NOTE
3743 For small 1-3 sentence descriptions, just add an entry at the end of
390390 // AttributeSet Introspection
391391 //===--------------------------------------------------------------------===//
392392
393 // FIXME: Remove this.
394 uint64_t Raw(unsigned Index) const;
395
396393 /// \brief Return a raw pointer that uniquely identifies this attribute list.
397394 void *getRawPointer() const {
398395 return pImpl;
457454 AttrBuilder()
458455 : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
459456 DerefOrNullBytes(0), AllocSizeArgs(0) {}
460 explicit AttrBuilder(uint64_t Val)
461 : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
462 DerefOrNullBytes(0), AllocSizeArgs(0) {
463 addRawValue(Val);
464 }
465457 AttrBuilder(const Attribute &A)
466458 : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
467459 DerefOrNullBytes(0), AllocSizeArgs(0) {
589581 bool operator!=(const AttrBuilder &B) {
590582 return !(*this == B);
591583 }
592
593 // FIXME: Remove this in 4.0.
594
595 /// \brief Add the raw value to the internal representation.
596 AttrBuilder &addRawValue(uint64_t Val);
597584 };
598585
599586 namespace AttributeFuncs {
5252 *
5353 * @{
5454 */
55
56 typedef enum {
57 LLVMZExtAttribute = 1<<0,
58 LLVMSExtAttribute = 1<<1,
59 LLVMNoReturnAttribute = 1<<2,
60 LLVMInRegAttribute = 1<<3,
61 LLVMStructRetAttribute = 1<<4,
62 LLVMNoUnwindAttribute = 1<<5,
63 LLVMNoAliasAttribute = 1<<6,
64 LLVMByValAttribute = 1<<7,
65 LLVMNestAttribute = 1<<8,
66 LLVMReadNoneAttribute = 1<<9,
67 LLVMReadOnlyAttribute = 1<<10,
68 LLVMNoInlineAttribute = 1<<11,
69 LLVMAlwaysInlineAttribute = 1<<12,
70 LLVMOptimizeForSizeAttribute = 1<<13,
71 LLVMStackProtectAttribute = 1<<14,
72 LLVMStackProtectReqAttribute = 1<<15,
73 LLVMAlignment = 31<<16,
74 LLVMNoCaptureAttribute = 1<<21,
75 LLVMNoRedZoneAttribute = 1<<22,
76 LLVMNoImplicitFloatAttribute = 1<<23,
77 LLVMNakedAttribute = 1<<24,
78 LLVMInlineHintAttribute = 1<<25,
79 LLVMStackAlignment = 7<<26,
80 LLVMReturnsTwice = 1 << 29,
81 LLVMUWTable = 1 << 30,
82 LLVMNonLazyBind = 1 << 31
83
84 /* FIXME: These attributes are currently not included in the C API as
85 a temporary measure until the API/ABI impact to the C API is understood
86 and the path forward agreed upon.
87 LLVMSanitizeAddressAttribute = 1ULL << 32,
88 LLVMStackProtectStrongAttribute = 1ULL<<35,
89 LLVMColdAttribute = 1ULL << 40,
90 LLVMOptimizeNoneAttribute = 1ULL << 42,
91 LLVMInAllocaAttribute = 1ULL << 43,
92 LLVMNonNullAttribute = 1ULL << 44,
93 LLVMJumpTableAttribute = 1ULL << 45,
94 LLVMConvergentAttribute = 1ULL << 46,
95 LLVMSafeStackAttribute = 1ULL << 47,
96 LLVMSwiftSelfAttribute = 1ULL << 48,
97 LLVMSwiftErrorAttribute = 1ULL << 49,
98 */
99 } LLVMAttribute;
10055
10156 typedef enum {
10257 /* Terminator Instructions */
20101965 *
20111966 * @see llvm::Function::addAttribute()
20121967 */
2013 void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA);
2014
20151968 void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
20161969 LLVMAttributeRef A);
20171970 unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx);
20361989 const char *V);
20371990
20381991 /**
2039 * Obtain an attribute from a function.
2040 *
2041 * @see llvm::Function::getAttributes()
2042 */
2043 LLVMAttribute LLVMGetFunctionAttr(LLVMValueRef Fn);
2044
2045 /**
2046 * Remove an attribute from a function.
2047 */
2048 void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA);
2049
2050 /**
20511992 * @defgroup LLVMCCoreValueFunctionParameters Function Parameters
20521993 *
20531994 * Functions in this group relate to arguments/parameters on functions.
21292070 LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
21302071
21312072 /**
2132 * Add an attribute to a function argument.
2133 *
2134 * @see llvm::Argument::addAttr()
2135 */
2136 void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA);
2137
2138 /**
2139 * Remove an attribute from a function argument.
2140 *
2141 * @see llvm::Argument::removeAttr()
2142 */
2143 void LLVMRemoveAttribute(LLVMValueRef Arg, LLVMAttribute PA);
2144
2145 /**
2146 * Get an attribute from a function argument.
2147 */
2148 LLVMAttribute LLVMGetAttribute(LLVMValueRef Arg);
2149
2150 /**
21512073 * Set the alignment for a function parameter.
21522074 *
21532075 * @see llvm::Argument::addAttr()
25952517 */
25962518 unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
25972519
2598 void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index, LLVMAttribute);
2599 void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
2600 LLVMAttribute);
26012520 void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
26022521 unsigned Align);
26032522
13541354 // Functions for parsing blocks from the bitcode file
13551355 //===----------------------------------------------------------------------===//
13561356
1357 static uint64_t getRawAttributeMask(Attribute::AttrKind Val) {
1358 switch (Val) {
1359 case Attribute::EndAttrKinds:
1360 llvm_unreachable("Synthetic enumerators which should never get here");
1361
1362 case Attribute::None: return 0;
1363 case Attribute::ZExt: return 1 << 0;
1364 case Attribute::SExt: return 1 << 1;
1365 case Attribute::NoReturn: return 1 << 2;
1366 case Attribute::InReg: return 1 << 3;
1367 case Attribute::StructRet: return 1 << 4;
1368 case Attribute::NoUnwind: return 1 << 5;
1369 case Attribute::NoAlias: return 1 << 6;
1370 case Attribute::ByVal: return 1 << 7;
1371 case Attribute::Nest: return 1 << 8;
1372 case Attribute::ReadNone: return 1 << 9;
1373 case Attribute::ReadOnly: return 1 << 10;
1374 case Attribute::NoInline: return 1 << 11;
1375 case Attribute::AlwaysInline: return 1 << 12;
1376 case Attribute::OptimizeForSize: return 1 << 13;
1377 case Attribute::StackProtect: return 1 << 14;
1378 case Attribute::StackProtectReq: return 1 << 15;
1379 case Attribute::Alignment: return 31 << 16;
1380 case Attribute::NoCapture: return 1 << 21;
1381 case Attribute::NoRedZone: return 1 << 22;
1382 case Attribute::NoImplicitFloat: return 1 << 23;
1383 case Attribute::Naked: return 1 << 24;
1384 case Attribute::InlineHint: return 1 << 25;
1385 case Attribute::StackAlignment: return 7 << 26;
1386 case Attribute::ReturnsTwice: return 1 << 29;
1387 case Attribute::UWTable: return 1 << 30;
1388 case Attribute::NonLazyBind: return 1U << 31;
1389 case Attribute::SanitizeAddress: return 1ULL << 32;
1390 case Attribute::MinSize: return 1ULL << 33;
1391 case Attribute::NoDuplicate: return 1ULL << 34;
1392 case Attribute::StackProtectStrong: return 1ULL << 35;
1393 case Attribute::SanitizeThread: return 1ULL << 36;
1394 case Attribute::SanitizeMemory: return 1ULL << 37;
1395 case Attribute::NoBuiltin: return 1ULL << 38;
1396 case Attribute::Returned: return 1ULL << 39;
1397 case Attribute::Cold: return 1ULL << 40;
1398 case Attribute::Builtin: return 1ULL << 41;
1399 case Attribute::OptimizeNone: return 1ULL << 42;
1400 case Attribute::InAlloca: return 1ULL << 43;
1401 case Attribute::NonNull: return 1ULL << 44;
1402 case Attribute::JumpTable: return 1ULL << 45;
1403 case Attribute::Convergent: return 1ULL << 46;
1404 case Attribute::SafeStack: return 1ULL << 47;
1405 case Attribute::NoRecurse: return 1ULL << 48;
1406 case Attribute::InaccessibleMemOnly: return 1ULL << 49;
1407 case Attribute::InaccessibleMemOrArgMemOnly: return 1ULL << 50;
1408 case Attribute::SwiftSelf: return 1ULL << 51;
1409 case Attribute::SwiftError: return 1ULL << 52;
1410 case Attribute::WriteOnly: return 1ULL << 53;
1411 case Attribute::Dereferenceable:
1412 llvm_unreachable("dereferenceable attribute not supported in raw format");
1413 break;
1414 case Attribute::DereferenceableOrNull:
1415 llvm_unreachable("dereferenceable_or_null attribute not supported in raw "
1416 "format");
1417 break;
1418 case Attribute::ArgMemOnly:
1419 llvm_unreachable("argmemonly attribute not supported in raw format");
1420 break;
1421 case Attribute::AllocSize:
1422 llvm_unreachable("allocsize not supported in raw format");
1423 break;
1424 }
1425 llvm_unreachable("Unsupported attribute type");
1426 }
1427
1428 static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
1429 if (!Val) return;
1430
1431 for (Attribute::AttrKind I = Attribute::None; I != Attribute::EndAttrKinds;
1432 I = Attribute::AttrKind(I + 1)) {
1433 if (I == Attribute::Dereferenceable ||
1434 I == Attribute::DereferenceableOrNull ||
1435 I == Attribute::ArgMemOnly ||
1436 I == Attribute::AllocSize)
1437 continue;
1438 if (uint64_t A = (Val & getRawAttributeMask(I))) {
1439 if (I == Attribute::Alignment)
1440 B.addAlignmentAttr(1ULL << ((A >> 16) - 1));
1441 else if (I == Attribute::StackAlignment)
1442 B.addStackAlignmentAttr(1ULL << ((A >> 26)-1));
1443 else
1444 B.addAttribute(I);
1445 }
1446 }
1447 }
1448
13571449 /// \brief This fills an AttrBuilder object with the LLVM attributes that have
13581450 /// been decoded from the given integer. This function must stay in sync with
13591451 /// 'encodeLLVMAttributesForBitcode'.
13691461
13701462 if (Alignment)
13711463 B.addAlignmentAttr(Alignment);
1372 B.addRawValue(((EncodedAttrs & (0xfffffULL << 32)) >> 11) |
1373 (EncodedAttrs & 0xffff));
1464 addRawAttributeValue(B, ((EncodedAttrs & (0xfffffULL << 32)) >> 11) |
1465 (EncodedAttrs & 0xffff));
13741466 }
13751467
13761468 std::error_code BitcodeReader::parseAttributeBlock() {
8484 ID.AddString(Kind);
8585 if (!Values.empty()) ID.AddString(Values);
8686 }
87
88 // FIXME: Remove this!
89 static uint64_t getAttrMask(Attribute::AttrKind Val);
9087 };
9188
9289 //===----------------------------------------------------------------------===//
257254 }
258255 }
259256
260 // FIXME: This atrocity is temporary.
261 uint64_t Raw(unsigned Index) const;
262
263257 void dump() const;
264258 };
265259
471471 return getKindAsString() < AI.getKindAsString();
472472 }
473473
474 uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) {
475 // FIXME: Remove this.
476 switch (Val) {
477 case Attribute::EndAttrKinds:
478 llvm_unreachable("Synthetic enumerators which should never get here");
479
480 case Attribute::None: return 0;
481 case Attribute::ZExt: return 1 << 0;
482 case Attribute::SExt: return 1 << 1;
483 case Attribute::NoReturn: return 1 << 2;
484 case Attribute::InReg: return 1 << 3;
485 case Attribute::StructRet: return 1 << 4;
486 case Attribute::NoUnwind: return 1 << 5;
487 case Attribute::NoAlias: return 1 << 6;
488 case Attribute::ByVal: return 1 << 7;
489 case Attribute::Nest: return 1 << 8;
490 case Attribute::ReadNone: return 1 << 9;
491 case Attribute::ReadOnly: return 1 << 10;
492 case Attribute::NoInline: return 1 << 11;
493 case Attribute::AlwaysInline: return 1 << 12;
494 case Attribute::OptimizeForSize: return 1 << 13;
495 case Attribute::StackProtect: return 1 << 14;
496 case Attribute::StackProtectReq: return 1 << 15;
497 case Attribute::Alignment: return 31 << 16;
498 case Attribute::NoCapture: return 1 << 21;
499 case Attribute::NoRedZone: return 1 << 22;
500 case Attribute::NoImplicitFloat: return 1 << 23;
501 case Attribute::Naked: return 1 << 24;
502 case Attribute::InlineHint: return 1 << 25;
503 case Attribute::StackAlignment: return 7 << 26;
504 case Attribute::ReturnsTwice: return 1 << 29;
505 case Attribute::UWTable: return 1 << 30;
506 case Attribute::NonLazyBind: return 1U << 31;
507 case Attribute::SanitizeAddress: return 1ULL << 32;
508 case Attribute::MinSize: return 1ULL << 33;
509 case Attribute::NoDuplicate: return 1ULL << 34;
510 case Attribute::StackProtectStrong: return 1ULL << 35;
511 case Attribute::SanitizeThread: return 1ULL << 36;
512 case Attribute::SanitizeMemory: return 1ULL << 37;
513 case Attribute::NoBuiltin: return 1ULL << 38;
514 case Attribute::Returned: return 1ULL << 39;
515 case Attribute::Cold: return 1ULL << 40;
516 case Attribute::Builtin: return 1ULL << 41;
517 case Attribute::OptimizeNone: return 1ULL << 42;
518 case Attribute::InAlloca: return 1ULL << 43;
519 case Attribute::NonNull: return 1ULL << 44;
520 case Attribute::JumpTable: return 1ULL << 45;
521 case Attribute::Convergent: return 1ULL << 46;
522 case Attribute::SafeStack: return 1ULL << 47;
523 case Attribute::NoRecurse: return 1ULL << 48;
524 case Attribute::InaccessibleMemOnly: return 1ULL << 49;
525 case Attribute::InaccessibleMemOrArgMemOnly: return 1ULL << 50;
526 case Attribute::SwiftSelf: return 1ULL << 51;
527 case Attribute::SwiftError: return 1ULL << 52;
528 case Attribute::WriteOnly: return 1ULL << 53;
529 case Attribute::Dereferenceable:
530 llvm_unreachable("dereferenceable attribute not supported in raw format");
531 break;
532 case Attribute::DereferenceableOrNull:
533 llvm_unreachable("dereferenceable_or_null attribute not supported in raw "
534 "format");
535 break;
536 case Attribute::ArgMemOnly:
537 llvm_unreachable("argmemonly attribute not supported in raw format");
538 break;
539 case Attribute::AllocSize:
540 llvm_unreachable("allocsize not supported in raw format");
541 break;
542 }
543 llvm_unreachable("Unsupported attribute type");
544 }
545
546474 //===----------------------------------------------------------------------===//
547475 // AttributeSetNode Definition
548476 //===----------------------------------------------------------------------===//
651579 //===----------------------------------------------------------------------===//
652580 // AttributeSetImpl Definition
653581 //===----------------------------------------------------------------------===//
654
655 uint64_t AttributeSetImpl::Raw(unsigned Index) const {
656 for (unsigned I = 0, E = getNumSlots(); I != E; ++I) {
657 if (getSlotIndex(I) != Index) continue;
658 const AttributeSetNode *ASN = getSlotNode(I);
659 uint64_t Mask = 0;
660
661 for (AttributeSetNode::iterator II = ASN->begin(),
662 IE = ASN->end(); II != IE; ++II) {
663 Attribute Attr = *II;
664
665 // This cannot handle string attributes.
666 if (Attr.isStringAttribute()) continue;
667
668 Attribute::AttrKind Kind = Attr.getKindAsEnum();
669
670 if (Kind == Attribute::Alignment)
671 Mask |= (Log2_32(ASN->getAlignment()) + 1) << 16;
672 else if (Kind == Attribute::StackAlignment)
673 Mask |= (Log2_32(ASN->getStackAlignment()) + 1) << 26;
674 else if (Kind == Attribute::Dereferenceable)
675 llvm_unreachable("dereferenceable not supported in bit mask");
676 else if (Kind == Attribute::AllocSize)
677 llvm_unreachable("allocsize not supported in bit mask");
678 else
679 Mask |= AttributeImpl::getAttrMask(Kind);
680 }
681
682 return Mask;
683 }
684
685 return 0;
686 }
687582
688583 LLVM_DUMP_METHOD void AttributeSetImpl::dump() const {
689584 AttributeSet(const_cast(this)).dump();
12191114 return pImpl->getSlotAttributes(Slot);
12201115 }
12211116
1222 uint64_t AttributeSet::Raw(unsigned Index) const {
1223 // FIXME: Remove this.
1224 return pImpl ? pImpl->Raw(Index) : 0;
1225 }
1226
12271117 LLVM_DUMP_METHOD void AttributeSet::dump() const {
12281118 dbgs() << "PAL[\n";
12291119
15221412
15231413 return Alignment == B.Alignment && StackAlignment == B.StackAlignment &&
15241414 DerefBytes == B.DerefBytes;
1525 }
1526
1527 AttrBuilder &AttrBuilder::addRawValue(uint64_t Val) {
1528 // FIXME: Remove this in 4.0.
1529 if (!Val) return *this;
1530
1531 for (Attribute::AttrKind I = Attribute::None; I != Attribute::EndAttrKinds;
1532 I = Attribute::AttrKind(I + 1)) {
1533 if (I == Attribute::Dereferenceable ||
1534 I == Attribute::DereferenceableOrNull ||
1535 I == Attribute::ArgMemOnly ||
1536 I == Attribute::AllocSize)
1537 continue;
1538 if (uint64_t A = (Val & AttributeImpl::getAttrMask(I))) {
1539 Attrs[I] = true;
1540
1541 if (I == Attribute::Alignment)
1542 Alignment = 1ULL << ((A >> 16) - 1);
1543 else if (I == Attribute::StackAlignment)
1544 StackAlignment = 1ULL << ((A >> 26)-1);
1545 }
1546 }
1547
1548 return *this;
15491415 }
15501416
15511417 //===----------------------------------------------------------------------===//
18341834 F->clearGC();
18351835 }
18361836
1837 void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
1838 Function *Func = unwrap(Fn);
1839 const AttributeSet PAL = Func->getAttributes();
1840 AttrBuilder B(PA);
1841 const AttributeSet PALnew =
1842 PAL.addAttributes(Func->getContext(), AttributeSet::FunctionIndex,
1843 AttributeSet::get(Func->getContext(),
1844 AttributeSet::FunctionIndex, B));
1845 Func->setAttributes(PALnew);
1846 }
1847
18481837 void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
18491838 LLVMAttributeRef A) {
18501839 unwrap(F)->addAttribute(Idx, unwrap(A));
18971886 Func->addAttributes(Idx, Set);
18981887 }
18991888
1900 void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
1901 Function *Func = unwrap(Fn);
1902 const AttributeSet PAL = Func->getAttributes();
1903 AttrBuilder B(PA);
1904 const AttributeSet PALnew =
1905 PAL.removeAttributes(Func->getContext(), AttributeSet::FunctionIndex,
1906 AttributeSet::get(Func->getContext(),
1907 AttributeSet::FunctionIndex, B));
1908 Func->setAttributes(PALnew);
1909 }
1910
1911 LLVMAttribute LLVMGetFunctionAttr(LLVMValueRef Fn) {
1912 Function *Func = unwrap(Fn);
1913 const AttributeSet PAL = Func->getAttributes();
1914 return (LLVMAttribute)PAL.Raw(AttributeSet::FunctionIndex);
1915 }
1916
19171889 /*--.. Operations on parameters ............................................--*/
19181890
19191891 unsigned LLVMCountParams(LLVMValueRef FnRef) {
19701942 if (I == A->getParent()->arg_begin())
19711943 return nullptr;
19721944 return wrap(&*--I);
1973 }
1974
1975 void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA) {
1976 Argument *A = unwrap(Arg);
1977 AttrBuilder B(PA);
1978 A->addAttr(AttributeSet::get(A->getContext(), A->getArgNo() + 1, B));
1979 }
1980
1981 void LLVMRemoveAttribute(LLVMValueRef Arg, LLVMAttribute PA) {
1982 Argument *A = unwrap(Arg);
1983 AttrBuilder B(PA);
1984 A->removeAttr(AttributeSet::get(A->getContext(), A->getArgNo() + 1, B));
1985 }
1986
1987 LLVMAttribute LLVMGetAttribute(LLVMValueRef Arg) {
1988 Argument *A = unwrap(Arg);
1989 return (LLVMAttribute)A->getParent()->getAttributes().
1990 Raw(A->getArgNo()+1);
19911945 }
19921946
19931947 void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) {
21962150 void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC) {
21972151 return CallSite(unwrap(Instr))
21982152 .setCallingConv(static_cast(CC));
2199 }
2200
2201 void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index,
2202 LLVMAttribute PA) {
2203 CallSite Call = CallSite(unwrap(Instr));
2204 AttrBuilder B(PA);
2205 Call.setAttributes(
2206 Call.getAttributes().addAttributes(Call->getContext(), index,
2207 AttributeSet::get(Call->getContext(),
2208 index, B)));
2209 }
2210
2211 void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
2212 LLVMAttribute PA) {
2213 CallSite Call = CallSite(unwrap(Instr));
2214 AttrBuilder B(PA);
2215 Call.setAttributes(Call.getAttributes()
2216 .removeAttributes(Call->getContext(), index,
2217 AttributeSet::get(Call->getContext(),
2218 index, B)));
22192153 }
22202154
22212155 void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,