summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r--llvm/lib/VMCore/Value.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp
index a61a1a02472..cf696fe44fe 100644
--- a/llvm/lib/VMCore/Value.cpp
+++ b/llvm/lib/VMCore/Value.cpp
@@ -136,6 +136,13 @@ unsigned Value::getNameLen() const {
return Name ? Name->getKeyLength() : 0;
}
+/// isName - Return true if this value has the name specified by the provided
+/// nul terminated string.
+bool Value::isName(const char *N) const {
+ unsigned InLen = strlen(N);
+ return InLen = getNameLen() && memcmp(getNameStart(), N, InLen) == 0;
+}
+
std::string Value::getNameStr() const {
if (Name == 0) return "";
OpenPOWER on IntegriCloud