diff options
author | Pavel Labath <labath@google.com> | 2018-05-18 11:35:46 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-05-18 11:35:46 +0000 |
commit | 981a34c4282de3ac3863b305df2ded130bed8242 (patch) | |
tree | edf1c4a80b86f461539c769d6abebd3890fc60b9 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 90d308ef4b3a8af58a9bb2a828d3243b664637cd (diff) | |
download | bcm5719-llvm-981a34c4282de3ac3863b305df2ded130bed8242.tar.gz bcm5719-llvm-981a34c4282de3ac3863b305df2ded130bed8242.zip |
Make ObjectFileMachO work on non-darwin platforms
Summary:
Before this patch we were unable to write cross-platform MachO tests
because the parsing code did not compile on other platforms. The reason
for that was that ObjectFileMachO depended on
RegisterContextDarwin_arm(64)? (presumably for core file parsing) and
the two Register Context classes uses constants from the system headers
(KERN_SUCCESS, KERN_INVALID_ARGUMENT).
As far as I can tell, these two files don't actually interact with the
darwin kernel -- they are used only in ObjectFileMachO and MacOSX-Kernel
process plugin (even though it has "kernel" in the name, this one
communicates with it via network packets and not syscalls). For the time
being I have created OS-independent definitions of these constants and
made the register context classes use those. Long term, the error
handling in these classes should be probably changed to use more
standard mechanisms such as Status or Error classes.
This is the only change necessary (apart from build system glue) to make
ObjectFileMachO work on other platforms. To demonstrate that, I remove
REQUIRES:darwin from our (only) cross-platform mach-o test.
Reviewers: jasonmolenda, aprantl, clayborg, javed.absar
Subscribers: mgorny, lldb-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D46934
llvm-svn: 332702
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions