Skip to content

Commit c67f189

Browse files
committed
Rename OB_type to OB_callee_type.
Created using spr 1.3.6-beta.1
2 parents 787045d + 066cbc4 commit c67f189

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

llvm/include/llvm/IR/LLVMContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class LLVMContext {
9696
OB_ptrauth = 7, // "ptrauth"
9797
OB_kcfi = 8, // "kcfi"
9898
OB_convergencectrl = 9, // "convergencectrl"
99-
OB_type = 10, // "type"
99+
OB_callee_type = 10, // "callee_type"
100100
};
101101

102102
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,8 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
33333333
{LLVMContext::OB_deopt, LLVMContext::OB_gc_transition,
33343334
LLVMContext::OB_gc_live, LLVMContext::OB_funclet,
33353335
LLVMContext::OB_cfguardtarget, LLVMContext::OB_ptrauth,
3336-
LLVMContext::OB_clang_arc_attachedcall, LLVMContext::OB_type}) &&
3336+
LLVMContext::OB_clang_arc_attachedcall,
3337+
LLVMContext::OB_callee_type}) &&
33373338
"Cannot lower invokes with arbitrary operand bundles yet!");
33383339

33393340
const Value *Callee(I.getCalledOperand());
@@ -3424,7 +3425,7 @@ void SelectionDAGBuilder::visitCallBr(const CallBrInst &I) {
34243425
// have to do anything here to lower funclet bundles.
34253426
assert(!I.hasOperandBundlesOtherThan({LLVMContext::OB_deopt,
34263427
LLVMContext::OB_funclet,
3427-
LLVMContext::OB_type}) &&
3428+
LLVMContext::OB_callee_type}) &&
34283429
"Cannot lower callbrs with arbitrary operand bundles yet!");
34293430

34303431
assert(I.isInlineAsm() && "Only know how to handle inlineasm callbr");
@@ -9588,7 +9589,7 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
95889589
{LLVMContext::OB_deopt, LLVMContext::OB_funclet,
95899590
LLVMContext::OB_cfguardtarget, LLVMContext::OB_preallocated,
95909591
LLVMContext::OB_clang_arc_attachedcall, LLVMContext::OB_kcfi,
9591-
LLVMContext::OB_convergencectrl, LLVMContext::OB_type}) &&
9592+
LLVMContext::OB_convergencectrl, LLVMContext::OB_callee_type}) &&
95929593
"Cannot lower calls with arbitrary operand bundles!");
95939594

95949595
SDValue Callee = getValue(I.getCalledOperand());

llvm/lib/IR/LLVMContext.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
8282
assert(Entry->second == BundleTagID && "operand bundle id drifted!");
8383
}
8484

85-
[[maybe_unused]] auto *TypeEntry = pImpl->getOrInsertBundleTag("type");
86-
assert(TypeEntry->second == LLVMContext::OB_type &&
87-
"type operand bundle id drifted!");
85+
[[maybe_unused]] auto *TypeEntry = pImpl->getOrInsertBundleTag("callee_type");
86+
assert(TypeEntry->second == LLVMContext::OB_callee_type &&
87+
"callee_type operand bundle id drifted!");
8888

8989
SyncScope::ID SingleThreadSSID =
9090
pImpl->getOrInsertSyncScopeID("singlethread");

llvm/lib/IR/Verifier.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3722,13 +3722,13 @@ void Verifier::visitCallBase(CallBase &Call) {
37223722
visitIntrinsicCall(ID, Call);
37233723

37243724
// Verify that a callsite has at most one operand bundle for each of the
3725-
// following: "deopt", "funclet", "gc-transition", "cfguardtarget", "type",
3726-
// "preallocated", and "ptrauth".
3725+
// following: "deopt", "funclet", "gc-transition", "cfguardtarget",
3726+
// "callee_type", "preallocated", and "ptrauth".
37273727
bool FoundDeoptBundle = false, FoundFuncletBundle = false,
37283728
FoundGCTransitionBundle = false, FoundCFGuardTargetBundle = false,
37293729
FoundPreallocatedBundle = false, FoundGCLiveBundle = false,
37303730
FoundPtrauthBundle = false, FoundKCFIBundle = false,
3731-
FoundAttachedCallBundle = false, FoundTypeBundle = false;
3731+
FoundAttachedCallBundle = false, FoundCalleeTypeBundle = false;
37323732
for (unsigned i = 0, e = Call.getNumOperandBundles(); i < e; ++i) {
37333733
OperandBundleUse BU = Call.getOperandBundleAt(i);
37343734
uint32_t Tag = BU.getTagID();
@@ -3791,9 +3791,10 @@ void Verifier::visitCallBase(CallBase &Call) {
37913791
"Multiple \"clang.arc.attachedcall\" operand bundles", Call);
37923792
FoundAttachedCallBundle = true;
37933793
verifyAttachedCallBundle(Call, BU);
3794-
} else if (Tag == LLVMContext::OB_type) {
3795-
Check(!FoundTypeBundle, "Multiple \"type\" operand bundles", Call);
3796-
FoundTypeBundle = true;
3794+
} else if (Tag == LLVMContext::OB_callee_type) {
3795+
Check(!FoundCalleeTypeBundle, "Multiple \"callee_type\" operand bundles",
3796+
Call);
3797+
FoundCalleeTypeBundle = true;
37973798
}
37983799
}
37993800

llvm/test/Verifier/operand-bundles.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ declare ptr @objc_unsafeClaimAutoreleasedReturnValue(ptr)
106106
declare void @llvm.assume(i1)
107107

108108
define void @f_type(ptr %ptr) {
109-
; CHECK: Multiple "type" operand bundles
110-
; CHECK-NEXT: call void @g() [ "type"(metadata !"_ZTSFvE.generalized"), "type"(metadata !"_ZTSFvE.generalized") ]
111-
; CHECK-NOT: call void @g() [ "type"(metadata !"_ZTSFvE.generalized") ]
109+
; CHECK: Multiple "callee_type" operand bundles
110+
; CHECK-NEXT: call void @g() [ "callee_type"(metadata !"_ZTSFvE.generalized"), "callee_type"(metadata !"_ZTSFvE.generalized") ]
111+
; CHECK-NOT: call void @g() [ "callee_type"(metadata !"_ZTSFvE.generalized") ]
112112

113113
entry:
114114
%l = load i32, ptr %ptr, align 4
115-
call void @g() [ "type"(metadata !"_ZTSFvE.generalized"), "type"(metadata !"_ZTSFvE.generalized") ]
116-
call void @g() [ "type"(metadata !"_ZTSFvE.generalized") ]
115+
call void @g() [ "callee_type"(metadata !"_ZTSFvE.generalized"), "callee_type"(metadata !"_ZTSFvE.generalized") ]
116+
call void @g() [ "callee_type"(metadata !"_ZTSFvE.generalized") ]
117117
%x = add i32 42, 1
118118
ret void
119119
}

0 commit comments

Comments
 (0)