diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-11-03 18:03:22 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-11-03 18:19:32 +0000 |
commit | f7cd6194a2320429b1569172b868b21947c37efa (patch) | |
tree | a748deaffd1ba4a2b593fff124043bed2c7b1997 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | 5adf6ab7ff9c0bcf32c58224aee6a6a3e901abee (diff) | |
download | llvm-f7cd6194a2320429b1569172b868b21947c37efa.zip llvm-f7cd6194a2320429b1569172b868b21947c37efa.tar.gz llvm-f7cd6194a2320429b1569172b868b21947c37efa.tar.bz2 |
[IR] IntrinsicInst.cpp - use StringRef::starts_with/ends_with instead of startswith/endswith. NFC.
startswith/endswith wrap starts_with/ends_with and will eventually go away (to more closely match string_view)
Also add missing assert message
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 20ae08d..a24ca8d 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -235,7 +235,7 @@ void DbgAssignIntrinsic::setValue(Value *V) { int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable, StringRef Name) { - assert(Name.startswith("llvm.")); + assert(Name.starts_with("llvm.") && "Unexpected intrinsic prefix"); // Do successive binary searches of the dotted name components. For // "llvm.gc.experimental.statepoint.p1i8.p1i32", we will find the range of @@ -265,7 +265,7 @@ int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable, return -1; StringRef NameFound = *LastLow; if (Name == NameFound || - (Name.startswith(NameFound) && Name[NameFound.size()] == '.')) + (Name.starts_with(NameFound) && Name[NameFound.size()] == '.')) return LastLow - NameTable.begin(); return -1; } |