forked from OSchip/llvm-project
[llvm-c] Make LLVMGetTargetFromName actually work
LLVMGetTargetFromName used to compare two char* strings directly. llvm-svn: 194771
This commit is contained in:
parent
0e38fc8d5e
commit
5a6cfda02e
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue