Skip to content

Commit e78226e

Browse files
committed
Rename metadata from ref to implicit.ref.
1 parent c574fb2 commit e78226e

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

llvm/docs/LangRef.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8577,10 +8577,10 @@ Example:
85778577
The ``nofree`` metadata indicates the memory pointed by the pointer will not be
85788578
freed after the attached instruction.
85798579

8580-
'``ref``' Metadata
8581-
^^^^^^^^^^^^^^^^^^
8580+
'``implicit.ref``' Metadata
8581+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
85828582

8583-
The ``ref`` metadata may be attached to a function or global variable
8583+
The ``implicit.ref`` metadata may be attached to a function or global variable
85848584
definition with a single argument that references a global object.
85858585
This is typically used when there is some implicit dependence between the
85868586
symbols that is otherwise opaque to the linker. One such example is metadata
@@ -8602,7 +8602,7 @@ Example:
86028602

86038603
@a = global i32 1
86048604
@b = global i32 2
8605-
@c = global i32 3, section "abc", !ref !0, !ref !1
8605+
@c = global i32 3, section "abc", !implicit.ref !0, !implicit.ref !1
86068606
!0 = !{ptr @a}
86078607
!1 = !{ptr @b}
86088608

llvm/include/llvm/IR/FixedMetadataKinds.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ LLVM_FIXED_MD_KIND(MD_noalias_addrspace, "noalias.addrspace", 41)
5656
LLVM_FIXED_MD_KIND(MD_callee_type, "callee_type", 42)
5757
LLVM_FIXED_MD_KIND(MD_nofree, "nofree", 43)
5858
LLVM_FIXED_MD_KIND(MD_captures, "captures", 44)
59-
LLVM_FIXED_MD_KIND(MD_ref, "ref", 45)
59+
LLVM_FIXED_MD_KIND(MD_implicit_ref, "implicit.ref", 45)

llvm/lib/IR/Verifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,12 +770,12 @@ void Verifier::visitGlobalValue(const GlobalValue &GV) {
770770
RangeLikeMetadataKind::AbsoluteSymbol);
771771
}
772772

773-
if (GO->hasMetadata(LLVMContext::MD_ref)) {
773+
if (GO->hasMetadata(LLVMContext::MD_implicit_ref)) {
774774
Check(!GO->isDeclaration(),
775775
"ref metadata must not be placed on a declaration", GO);
776776

777777
SmallVector<MDNode *> MDs;
778-
GO->getMetadata(LLVMContext::MD_ref, MDs);
778+
GO->getMetadata(LLVMContext::MD_implicit_ref, MDs);
779779
for (const MDNode *MD : MDs) {
780780
Check(MD->getNumOperands() == 1, "ref metadata must have one operand",
781781
&GV, MD);

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,7 @@ void PPCAIXAsmPrinter::emitGlobalVariableHelper(const GlobalVariable *GV) {
27992799
// Switch to the containing csect.
28002800
OutStreamer->switchSection(Csect);
28012801

2802-
if (GV->hasMetadata(LLVMContext::MD_ref)) {
2802+
if (GV->hasMetadata(LLVMContext::MD_implicit_ref)) {
28032803
emitRefMetadata(GV);
28042804
}
28052805

@@ -2902,7 +2902,7 @@ void PPCAIXAsmPrinter::emitFunctionEntryLabel() {
29022902
OutStreamer->emitLabel(
29032903
getObjFileLowering().getFunctionEntryPointSymbol(Alias, TM));
29042904

2905-
if (F->hasMetadata(LLVMContext::MD_ref)) {
2905+
if (F->hasMetadata(LLVMContext::MD_implicit_ref)) {
29062906
emitRefMetadata(F);
29072907
}
29082908
}
@@ -3346,7 +3346,7 @@ void PPCAIXAsmPrinter::emitTTypeReference(const GlobalValue *GV,
33463346

33473347
void PPCAIXAsmPrinter::emitRefMetadata(const GlobalObject *GO) {
33483348
SmallVector<MDNode *> MDs;
3349-
GO->getMetadata(LLVMContext::MD_ref, MDs);
3349+
GO->getMetadata(LLVMContext::MD_implicit_ref, MDs);
33503350
assert(MDs.size() && "Expected asscoiated metadata nodes");
33513351

33523352
for (const MDNode *MD : MDs) {

llvm/test/CodeGen/PowerPC/aix-func-ref.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
@b = global i32 2
1515
@c = global i32 3
1616

17-
define i32 @foo() !ref !0 {
17+
define i32 @foo() !implicit.ref !0 {
1818
ret i32 0
1919
}
2020

21-
define i32 @bar() !ref !1 !ref !2 {
21+
define i32 @bar() !implicit.ref !1 !implicit.ref !2 {
2222
ret i32 0
2323
}
2424

llvm/test/CodeGen/PowerPC/aix-ref-metadata.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
@a = global i32 1
1111
@b = global i32 2
1212
@c = global i32 3, section "custom_section_c"
13-
@d = global i32 4, !ref !0
14-
@e = constant i32 5, !ref !1, !ref!2
15-
@f = global i32 6, section "custom_section_f", !ref !1
13+
@d = global i32 4, !implicit.ref !0
14+
@e = constant i32 5, !implicit.ref !1, !implicit.ref!2
15+
@f = global i32 6, section "custom_section_f", !implicit.ref !1
1616

1717

1818
!0 = !{ptr @a}

llvm/test/Verifier/ref-func.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
@a = global i32 1
44
@b = global i32 2
5-
@c = global i32 3, !ref !0
5+
@c = global i32 3, !implicit.ref !0
66

7-
define i32 @foo() !ref !1 {
7+
define i32 @foo() !implicit.ref !1 {
88
ret i32 0
99
}
1010

llvm/test/Verifier/ref.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
; RUN: not llvm-as -disable-output < %s -o /dev/null 2>&1 | FileCheck %s
22

3-
@a = global i32 1, !ref !0
4-
@b = global i32 2, !ref !1
5-
@c = global i32 3, !ref !1, !ref !2
6-
@d = global i32 4, !ref !3
7-
@e = external global i32, !ref !1
3+
@a = global i32 1, !implicit.ref !0
4+
@b = global i32 2, !implicit.ref !1
5+
@c = global i32 3, !implicit.ref !1, !implicit.ref !2
6+
@d = global i32 4, !implicit.ref !3
7+
@e = external global i32, !implicit.ref !1
88

99
!0 = !{i32 1}
1010
!1 = !{ptr @b}

0 commit comments

Comments
 (0)