This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Use freestanding stdint.h header for DeviceRTL
ClosedPublic

Authored by jhuber6 on Mar 13 2023, 10:22 AM.

Details

Summary

The stdint.h header provides the standard types. Previously we used
-nostdinc and defined these ourselves. This patch switches to a
freestanding version which should work properly. Without
-ffreestanding the stdint.h header will include other libraries. But
in a freestanding environment it should work given the primitives.

Diff Detail

Event Timeline

jhuber6 created this revision.Mar 13 2023, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2023, 10:22 AM
jhuber6 requested review of this revision.Mar 13 2023, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2023, 10:22 AM
jdoerfert accepted this revision.Mar 13 2023, 10:25 AM

Assuming this doesn't break things. LGTM

This revision is now accepted and ready to land.Mar 13 2023, 10:25 AM
openmp/libomptarget/DeviceRTL/include/Types.h
15

can we use <cstdin>?

jhuber6 added inline comments.Mar 13 2023, 10:28 AM
openmp/libomptarget/DeviceRTL/include/Types.h
15

Should be fine, but I couldn't decide if it were better to use the C version to avoid picking up any other stuff the C++ file wants to include.