This is an archive of the discontinued LLVM Phabricator instance.

Add offsetof support to expression evaluator.
ClosedPublic

Authored by teemperor on Jul 18 2019, 6:16 AM.

Details

Summary

We currently don't support offsetof in the expression evaluator as it is implemented as a macro
(which then calls __builtin_offsetof) in stddef.h. The best solution would be to include that
header (or even better, import Clang's builtin module), but header-parsing and
(cross-platform) importing modules is not ready yet.

Until we get this working with modules I would say we add the macro to our existing macro list
as we already do with other macros from stddef.h/stdint.h. We should be able to drop all of them
once we can import the relevant modules by default.

rdar://26040641

Diff Detail

Event Timeline

teemperor created this revision.Jul 18 2019, 6:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2019, 6:16 AM
davide accepted this revision.Jul 18 2019, 8:06 AM

This is good for now. I would add a comment explaining what you explained in the differential at the beginning of the macro section.
Great work!

This revision is now accepted and ready to land.Jul 18 2019, 8:06 AM
This revision was automatically updated to reflect the committed changes.

Thanks for fixing this one!