aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-10-18 17:29:04 -0700
committerKazu Hirata <kazu@google.com>2023-10-18 17:29:04 -0700
commit5b83bd133d705b024bfb34e4941941689456ba8c (patch)
tree983104ba1d192a3e5cdef582ca86658ac425d89e /llvm/lib/IR/Value.cpp
parentcfbf0a500f173b532f64fcb856af2fb0cb7ba725 (diff)
downloadllvm-5b83bd133d705b024bfb34e4941941689456ba8c.zip
llvm-5b83bd133d705b024bfb34e4941941689456ba8c.tar.gz
llvm-5b83bd133d705b024bfb34e4941941689456ba8c.tar.bz2
[llvm] Use StringRef::contains (NFC)
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 41260a98..b485a62 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -330,8 +330,7 @@ void Value::setNameImpl(const Twine &NewName) {
SmallString<256> NameData;
StringRef NameRef = NeedNewName ? NewName.toStringRef(NameData) : "";
- assert(NameRef.find_first_of(0) == StringRef::npos &&
- "Null bytes are not allowed in names");
+ assert(!NameRef.contains(0) && "Null bytes are not allowed in names");
// Name isn't changing?
if (getName() == NameRef)