[llvm-c] Simplify signature of LLVMGetTargetFromName

LLVMGetTargetFromName was not yet present in an LLVM release,
so this does not break compatibility.

llvm-svn: 194769
diff --git a/llvm/include/llvm-c/TargetMachine.h b/llvm/include/llvm-c/TargetMachine.h
index 84f9144..15d664f 100644
--- a/llvm/include/llvm-c/TargetMachine.h
+++ b/llvm/include/llvm-c/TargetMachine.h
@@ -64,7 +64,7 @@
 /*===-- Target ------------------------------------------------------------===*/
 /** Finds the target corresponding to the given name and stores it in \p T. 
   Returns 0 on success. */
-LLVMBool LLVMGetTargetFromName(const char *Name, LLVMTargetRef *T);
+LLVMTargetRef LLVMGetTargetFromName(const char *Name);
 
 /** Finds the target corresponding to the given triple and stores it in \p T.
   Returns 0 on success. Optionally returns any error in ErrorMessage.
diff --git a/llvm/lib/Target/TargetMachineC.cpp b/llvm/lib/Target/TargetMachineC.cpp
index 36600d1..061d0e9 100644
--- a/llvm/lib/Target/TargetMachineC.cpp
+++ b/llvm/lib/Target/TargetMachineC.cpp
@@ -72,17 +72,14 @@
   return wrap(unwrap(T)->getNext());
 }
 
-LLVMBool LLVMGetTargetFromName(const char *Name, LLVMTargetRef *T) {
+LLVMTargetRef LLVMGetTargetFromName(const char *Name) {
   for (TargetRegistry::iterator IT = TargetRegistry::begin(),
                                 IE = TargetRegistry::end(); IT != IE; ++IT) {
-    if (IT->getName() == Name) {
-      *T = wrap(&*IT);
-
-      return 0;
-    }
+    if (IT->getName() == Name)
+      return wrap(&*IT);
   }
   
-  return 1;
+  return NULL;
 }
 
 LLVMBool LLVMGetTargetFromTriple(const char* TripleStr, LLVMTargetRef *T,