[llvm-c] Simplify signature of LLVMGetTargetFromName

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

llvm-svn: 194769
This commit is contained in:
Peter Zotov 2013-11-15 02:51:01 +00:00
parent 1c6fd20427
commit b2c8b8a460
2 changed files with 5 additions and 8 deletions

View File

@ -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.

View File

@ -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,