This is an archive of the discontinued LLVM Phabricator instance.

[Host.mm] Check for the right macro instead of inlining it
AcceptedPublic

Authored by vsk on Feb 3 2020, 5:42 PM.

Diff Detail

Event Timeline

davide created this revision.Feb 3 2020, 5:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2020, 5:42 PM
vsk added inline comments.Feb 4 2020, 10:31 AM
lldb/source/Host/macosx/objcxx/Host.mm
14

This is missing __arm__, right? Why not just include TargetConditionals.h and change the the check to TARGET_OS_EMBEDDED?

https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h

I don't know about checking for NO_XPC_SERVICES for these -- they're LaunchServices/AppleScript related. As Vedant mentioned with the earlier check, I think TARGET_OS_EMBEDDED rather than an architecture check would be the most correct change; these services are not available on iOS etc.

vsk commandeered this revision.Feb 10 2020, 9:57 AM
vsk edited reviewers, added: davide; removed: vsk.

This just came up again as the watchOS/tvOS build breaks without the TARGET_OS_EMBEDDED check.

vsk updated this revision to Diff 243608.Feb 10 2020, 9:58 AM
vsk retitled this revision from [Host.mm] Check for the right macro instead of inlining it. to [Host.mm] Check for the right macro instead of inlining it.
  • Check TARGET_OS_EMBEDDED.
davide accepted this revision.Feb 10 2020, 10:00 AM

LGTM =)

This revision is now accepted and ready to land.Feb 10 2020, 10:00 AM
This revision was automatically updated to reflect the committed changes.

I think this is now causing a warning:

1600⧐952 ( 37%) Building CXX object tools/lldb/source/Host/macosx/objcxx/CMakeFiles/lldbHostMacOSXObjCXX.dir/Host.mm.o
/Users/teemperor/2llvm/llvm-project/lldb/source/Host/macosx/objcxx/Host.mm:139:14: warning: unused function 'AcceptPIDFromInferior' [-Wunused-function]
static void *AcceptPIDFromInferior(void *arg) {
             ^
1 warning generated.
vsk reopened this revision.Feb 10 2020, 2:41 PM

Reverted in bf65f19bce88fd9f1a74154d92afe37193ecd7a5. Jason pointed out this breaks macOS, as TARGET_OS_EMBEDDED is always defined (just not always to 1). Let's try this again.

This revision is now accepted and ready to land.Feb 10 2020, 2:41 PM
vsk updated this revision to Diff 243679.Feb 10 2020, 2:43 PM
vsk added a reviewer: jasonmolenda.