forked from OSchip/llvm-project
add a new helper method. It is unclear to me why this doesn't work, but GCC
won't match it: template<std::size_t StrLen> bool isName(const char Str[StrLen]) const { return getLength() == StrLen-1 && !memcmp(getName(), Str, StrLen-1); } llvm-svn: 59605
This commit is contained in:
parent
66e3877b42
commit
49c017f4ea
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue