dladdr is not available on AIX. Similar functionality is presented through loadquery. This patch replaces a use of dladdr with a version based on loadquery.
I believe that the conditions being checked for with llvm_unreachable in this patch are of the debug-only variety; however, some input would be appreciated regarding the choice of using llvm_unreachable instead of report_fatal_error or assert.
Based on available documentation, this situation should not occur (and thus I believe llvm_unreachable is appropriate).
This situation is not impossible, but highly improbable. This is a non-programmatic error, and the Programmer's Manual appears to recommend the use of report_fatal_error. Some additional guidance would be appreciated.
This is also supposed to not happen.
Thanks @xingxue for the review. I will update for the error handling before committing.
I'll leave this one as llvm_unreachable, either the failure is resolved on a later call or the loop will terminate when the amount of memory to request (checked below) is too large.
I will change this to report_fatal_error.
I will change this to report_fatal_error. Infinite loops are unfriendly.