aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetMachineC.cpp
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2013-11-15 02:51:18 +0000
committerPeter Zotov <whitequark@whitequark.org>2013-11-15 02:51:18 +0000
commite016a163e97d29a4c343189e678633066a3365ab (patch)
tree0a1c32f73c761e177a36a6d85f1705e0ed617ea5 /lib/Target/TargetMachineC.cpp
parentfa74752298602e0b74fb60ce3f0e76d0c461d3d8 (diff)
downloadexternal_llvm-e016a163e97d29a4c343189e678633066a3365ab.zip
external_llvm-e016a163e97d29a4c343189e678633066a3365ab.tar.gz
external_llvm-e016a163e97d29a4c343189e678633066a3365ab.tar.bz2
[llvm-c] Make LLVMGetTargetFromName actually work
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
Diffstat (limited to 'lib/Target/TargetMachineC.cpp')
-rw-r--r--lib/Target/TargetMachineC.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/TargetMachineC.cpp b/lib/Target/TargetMachineC.cpp
index e111380..3d5f827 100644
--- a/lib/Target/TargetMachineC.cpp
+++ b/lib/Target/TargetMachineC.cpp
@@ -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);
}