This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ/ZOS] Add header file to encapsulate use of <sysexits.h>
ClosedPublic

Authored by Kai on Jul 9 2020, 4:14 AM.

Details

Summary

The non-standard header file <sysexits.h> provides some return values.
EX_IOERR is used to as a special value to signal a broken pipe to the clang driver.
On z/OS Unix System Services, this header file does not exists. This patch

  • adds a check for <sysexits.h>, removing the dependency on LLVM_ON_UNIX
  • adds a new header file llvm/Support/ExitCodes, which either includes <sysexits.h> or defines EX_IOERR
  • updates the users of EX_IOERR to include the new header file

Diff Detail

Event Timeline

Kai created this revision.Jul 9 2020, 4:14 AM
llvm/include/llvm/Support/ExitCodes.h
23

Minor nits:
s/exists/exist/;
s/used value/value used/;

Kai updated this revision to Diff 278146.Jul 15 2020, 4:56 AM

Fixed two typos in the comment.

Kai marked an inline comment as done.Jul 15 2020, 4:57 AM

Thank you for pointing out the typo!

LGTM from my end.

This revision is now accepted and ready to land.Jul 15 2020, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2020, 9:46 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mgorny added inline comments.Sep 23 2020, 3:31 AM
llvm/include/llvm/Support/ExitCodes.h
20

This is a private LLVM header and it's not installed. Therefore, this installed header references uninstalled headers and breaks standalone builds of clang. Please use llvm-config.h instead.