Skip to content

Commit d77f2c0

Browse files
committed
fixup! Switch to fixed MD
Created using spr 1.3.8-beta.1
1 parent a6a16e6 commit d77f2c0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

llvm/include/llvm/IR/FixedMetadataKinds.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ LLVM_FIXED_MD_KIND(MD_mmra, "mmra", 40)
5555
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)
58+
LLVM_FIXED_MD_KIND(MD_alloc_token_hint, "alloc_token_hint", 44)

llvm/lib/Transforms/Instrumentation/AllocToken.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ STATISTIC(NumAllocations, "Allocations found");
144144
///
145145
/// Expected format is: !{<type-name>}
146146
MDNode *getAllocTokenHintMetadata(const CallBase &CB) {
147-
MDNode *Ret = CB.getMetadata("alloc_token_hint");
147+
MDNode *Ret = CB.getMetadata(LLVMContext::MD_alloc_token_hint);
148148
if (!Ret)
149149
return nullptr;
150150
assert(Ret->getNumOperands() == 1 && "bad !alloc_token_hint");

llvm/lib/Transforms/Utils/Local.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,6 +3025,10 @@ static void combineMetadata(Instruction *K, const Instruction *J,
30253025
// Preserve !nosanitize if both K and J have it.
30263026
K->setMetadata(Kind, JMD);
30273027
break;
3028+
case LLVMContext::MD_alloc_token_hint:
3029+
// Preserve !alloc_token_hint if both K and J have it.
3030+
K->setMetadata(Kind, JMD);
3031+
break;
30283032
}
30293033
}
30303034
// Set !invariant.group from J if J has it. If both instructions have it

0 commit comments

Comments
 (0)