forked from OSchip/llvm-project
Add a new getLength() method to IdentifierInfo, which relies on a newly added
method to StringMapEntry. Steve, please use this to remove the strlen calls in selector processing. llvm-svn: 42481
This commit is contained in:
parent
b06396c588
commit
2b6abdce50
|
@ -53,8 +53,17 @@ public:
|
|||
/// string is properly null terminated.
|
||||
///
|
||||
const char *getName() const {
|
||||
// String data is stored immediately after the IdentifierInfo object.
|
||||
return (const char*)(this+1);
|
||||
// We know that this is embedded into a StringMapEntry, and it knows how to
|
||||
// efficiently find the string.
|
||||
return llvm::StringMapEntry<IdentifierInfo>::
|
||||
GetStringMapEntryFromValue(*this).getKeyData();
|
||||
}
|
||||
|
||||
/// getLength - Efficiently return the length of this identifier info.
|
||||
///
|
||||
unsigned getLength() const {
|
||||
return llvm::StringMapEntry<IdentifierInfo>::
|
||||
GetStringMapEntryFromValue(*this).getKeyLength();
|
||||
}
|
||||
|
||||
/// getMacroInfo - Return macro information about this identifier, or null if
|
||||
|
|
Loading…
Reference in New Issue