aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/IdentifierTable.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index cbd27547ac..7801304751 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -62,6 +62,12 @@ class IdentifierInfo {
public:
IdentifierInfo();
+ /// isName - Return true if this is the identifier for the specified string.
+ bool isName(const char *Str) const {
+ unsigned Len = strlen(Str);
+ return getLength() == Len && !memcmp(getName(), Str, Len);
+ }
+
/// getName - Return the actual string for this identifier. The returned
/// string is properly null terminated.
///