aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm-c/TargetMachine.h2
-rw-r--r--lib/Target/TargetMachineC.cpp11
2 files changed, 5 insertions, 8 deletions
diff --git a/include/llvm-c/TargetMachine.h b/include/llvm-c/TargetMachine.h
index 84f9144..15d664f 100644
--- a/include/llvm-c/TargetMachine.h
+++ b/include/llvm-c/TargetMachine.h
@@ -64,7 +64,7 @@ LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T);
/*===-- 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/lib/Target/TargetMachineC.cpp b/lib/Target/TargetMachineC.cpp
index 36600d1..061d0e9 100644
--- a/lib/Target/TargetMachineC.cpp
+++ b/lib/Target/TargetMachineC.cpp
@@ -72,17 +72,14 @@ LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T) {
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,