Lookup handler name only when assertions are enabled.

llvm-svn: 83114
This commit is contained in:
Devang Patel 2009-09-29 22:05:52 +00:00
parent 39b5b72d74
commit c1e370a29c

View File

@ -262,8 +262,8 @@ NamedMDNode::~NamedMDNode() {
unsigned MetadataContext::RegisterMDKind(const char *Name) {
assert (validName(Name) && "Invalid custome metadata name!");
unsigned Count = MDHandlerNames.size();
StringMap<unsigned>::iterator I = MDHandlerNames.find(Name);
assert(I == MDHandlerNames.end() && "Already registered MDKind!");
assert(MDHandlerNames.find(Name) == MDHandlerNames.end()
&& "Already registered MDKind!");
MDHandlerNames[Name] = Count + 1;
return Count + 1;
}