Skip to content

Commit 5397b6b

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.8-beta.1 [skip ci]
1 parent 68b4783 commit 5397b6b

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ void CodeGenFunction::EmitAllocTokenHint(llvm::CallBase *CB,
12851285

12861286
// Format: !{<type-name>}
12871287
auto *MDN = llvm::MDNode::get(CGM.getLLVMContext(), {TypeMDS});
1288-
CB->setMetadata("alloc_token_hint", MDN);
1288+
CB->setMetadata(llvm::LLVMContext::MD_alloc_token_hint, MDN);
12891289
}
12901290

12911291
CodeGenFunction::ComplexPairTy CodeGenFunction::

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)