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:
Chris Lattner 2008-11-19 07:49:14 +00:00
parent 66e3877b42
commit 49c017f4ea
1 changed files with 6 additions and 0 deletions

View File

@ -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.
///