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.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
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.
tools/libclang/CIndexer.cpp | ||
---|---|---|
61 | Based on available documentation, this situation should not occur (and thus I believe llvm_unreachable is appropriate). | |
65 | 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. | |
84 | This is also supposed to not happen. |
Thanks @xingxue for the review. I will update for the error handling before committing.
tools/libclang/CIndexer.cpp | ||
---|---|---|
61 | 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. | |
65 | I will change this to report_fatal_error. | |
84 | I will change this to report_fatal_error. Infinite loops are unfriendly. |
Use of report_fatal_error/llvm_unreachable isn't fully consistent within the LLVM codebase, but I think your choices here are sensible.
Based on available documentation, this situation should not occur (and thus I believe llvm_unreachable is appropriate).