[llvm-c] Make LLVMGetTargetFromName actually work

LLVMGetTargetFromName used to compare two char* strings directly.

llvm-svn: 194771
This commit is contained in:
Peter Zotov 2013-11-15 02:51:18 +00:00
parent 0e38fc8d5e
commit 5a6cfda02e
1 changed files with 2 additions and 1 deletions

View File

@ -73,9 +73,10 @@ LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T) {
}
LLVMTargetRef LLVMGetTargetFromName(const char *Name) {
StringRef NameRef = Name;
for (TargetRegistry::iterator IT = TargetRegistry::begin(),
IE = TargetRegistry::end(); IT != IE; ++IT) {
if (IT->getName() == Name)
if (IT->getName() == NameRef)
return wrap(&*IT);
}