This is an archive of the discontinued LLVM Phabricator instance.

[MachO] Use error instead of fatal for missing -arch
ClosedPublic

Authored by smeenai on Oct 30 2021, 4:55 PM.

Details

Reviewers
gkm
int3
Group Reviewers
Restricted Project
Commits
rG264d3b6d4e08: [MachO] Use error instead of fatal for missing -arch
Summary

fatal should only be used for malformed inputs according to
ErrorHandler.h; error is more appropriate for missing arguments,
accompanied by a check to bail out early in case of the error. Some
tests need to be adjusted accordingly.

Makes lld/test/MachO/arch.s pass with LLD_IN_TEST=2.

Diff Detail

Event Timeline

smeenai created this revision.Oct 30 2021, 4:55 PM
Herald added a project: Restricted Project. · View Herald Transcript
smeenai requested review of this revision.Oct 30 2021, 4:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 30 2021, 4:55 PM
int3 added a subscriber: int3.Oct 30 2021, 7:25 PM
int3 added inline comments.
lld/test/MachO/color-diagnostics.test
9

do we really need to test this particular error? I was under the impression that this test was meant solely to test that the correct ANSI color codes were emitted, and the exact error message isn't so important

lld/test/MachO/search-paths-darwin.test
6

hm, why can't we use %lld here?

smeenai added inline comments.Oct 31 2021, 3:56 PM
lld/test/MachO/color-diagnostics.test
9

I was trying to preserve the behavior of the original, but yeah, I don't think there's any value to the additional test.

lld/test/MachO/search-paths-darwin.test
6

It adds a -syslibroot argument, which we want to avoid for this test.

smeenai updated this revision to Diff 383691.Oct 31 2021, 3:57 PM

Address review comments

smeenai marked 2 inline comments as done.Oct 31 2021, 3:57 PM
int3 accepted this revision.Oct 31 2021, 4:30 PM

ah makes sense. Thanks!

This revision is now accepted and ready to land.Oct 31 2021, 4:30 PM
This revision was automatically updated to reflect the committed changes.