[PATCH] D61225: [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABI

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 12:57:01 PDT 2019


efriedma added subscribers: mgrang, rsmith.
efriedma added a comment.

I was going to ask if local variables are also supposed to be aligned this way... but I guess there's no way for standard C++ code to tell without explicitly making weird alignment assumptions, so let's not worry about that.

This should do the right thing, as far as I can tell.

It probably would make sense to refactor the arm64-specific code into a TargetInfo API... or at least the triple check.  Not sure what that would look like; maybe `virtual uint64_t getMinGlobalAlign(uint64_t TypeSize)`?  Or maybe should just be "bool useMicrosoftGlobalAlign()" and keep the main logic here, if the rule is the same for multiple Windows targets.

Needs a testcase in test/CodeGenCXX/ demonstrating the alignment of the emitted global in various cases.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61225/new/

https://reviews.llvm.org/D61225





More information about the cfe-commits mailing list