This is an archive of the discontinued LLVM Phabricator instance.

[LLVM][Alignment] Introduce Alignment Type in DataLayout
ClosedPublic

Authored by gchatelet on Jul 31 2019, 9:45 AM.

Details

Summary

This is patch is part of a serie to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Event Timeline

gchatelet created this revision.Jul 31 2019, 9:45 AM
jfb added inline comments.
llvm/include/llvm/IR/DataLayout.h
269

Return MaybeAlign here? Or in a future patch?

275

Ditto.

gchatelet marked an inline comment as done.Jul 31 2019, 10:12 AM
gchatelet added inline comments.
llvm/include/llvm/IR/DataLayout.h
269

Touching interfaces of widely used types is very contaminating and pulling the string leads to huge patches that are hard to review.
My rough plan is the following:

  • Change the implementation details of the widely used types but don't touch the interface if it triggers too much changes
  • Change the leaves implementations, e.g. llvm/lib/Target/XXX. The changes here should be self contained.
  • Change interfaces of widely used types, one interface at a time.

I'll have a look at what it takes to include it in this patch and report back.

gchatelet updated this revision to Diff 212752.Aug 1 2019, 1:48 AM
  • Make getFunctionPtrAlign() return MaybeAlign
gchatelet updated this revision to Diff 213001.Aug 2 2019, 2:46 AM
gchatelet marked an inline comment as done.

Also changed getFunctionPtrAlign() return type to MaybeAlign.
Keeping getStackAlignment() return type as unsigned for now.

jfb accepted this revision.Aug 2 2019, 9:51 AM
This revision is now accepted and ready to land.Aug 2 2019, 9:51 AM
This revision was automatically updated to reflect the committed changes.