Skip to content

Commit

Permalink
[llvm-c] Make LLVMGetTargetFromName actually work
Browse files Browse the repository at this point in the history
LLVMGetTargetFromName used to compare two char* strings directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194771 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
whitequark committed Nov 15, 2013
1 parent fa74752 commit e016a16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Target/TargetMachineC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e016a16

Please sign in to comment.