mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Provide basic type safety for array_pod_sort comparators.
This makes using array_pod_sort significantly safer. The implementation relies on function pointer casting but that should be safe as we're dealing with void* here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191175 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -135,9 +135,9 @@ const Target *TargetRegistry::getClosestTargetForJIT(std::string &Error) {
|
||||
return TheTarget;
|
||||
}
|
||||
|
||||
static int TargetArraySortFn(const void *LHS, const void *RHS) {
|
||||
typedef std::pair<StringRef, const Target*> pair_ty;
|
||||
return ((const pair_ty*)LHS)->first.compare(((const pair_ty*)RHS)->first);
|
||||
static int TargetArraySortFn(const std::pair<StringRef, const Target *> *LHS,
|
||||
const std::pair<StringRef, const Target *> *RHS) {
|
||||
return LHS->first.compare(RHS->first);
|
||||
}
|
||||
|
||||
void TargetRegistry::printRegisteredTargetsForVersion() {
|
||||
|
||||
Reference in New Issue
Block a user