forked from OSchip/llvm-project
[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:
parent
1c6fd20427
commit
b2c8b8a460
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue