Skip to content

Commit 8888352

Browse files
authored
[NFC] Eliminate use of lookupLLVMIntrinsicByName in Coroutines (#114851)
Eliminate use of `lookupLLVMIntrinsicByName` from Coroutines in preparation of changing it to support a different form of intrinsic name table generated by intrinsic emitter. Also eliminate call to `isCoroutineIntrinsicName` from `declaresAnyIntrinsic` as the list of names traversed is the same list which `isCoroutineIntrinsicName` checks.
1 parent bf483dd commit 8888352

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Transforms/Coroutines/Coroutines.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ static const char *const CoroIntrinsics[] = {
100100

101101
#ifndef NDEBUG
102102
static bool isCoroutineIntrinsicName(StringRef Name) {
103-
return Intrinsic::lookupLLVMIntrinsicByName(CoroIntrinsics, Name, "coro") !=
104-
-1;
103+
return llvm::binary_search(CoroIntrinsics, Name);
105104
}
106105
#endif
107106

@@ -111,7 +110,6 @@ bool coro::isSuspendBlock(BasicBlock *BB) {
111110

112111
bool coro::declaresAnyIntrinsic(const Module &M) {
113112
for (StringRef Name : CoroIntrinsics) {
114-
assert(isCoroutineIntrinsicName(Name) && "not a coroutine intrinsic");
115113
if (M.getNamedValue(Name))
116114
return true;
117115
}

0 commit comments

Comments
 (0)