This is an archive of the discontinued LLVM Phabricator instance.

Redo "Make global aliases have symbol size equal to their type"
ClosedPublic

Authored by john.brawn on Aug 11 2015, 7:14 AM.

Details

Summary

r242520 was reverted in r244313 as the expected behaviour of the alias attribute in C is that the alias has the same size as the aliasee. However we can re-introduce adding the size on the alias when the aliasee does not, from a source code or object perspective, exist as a discrete entity. This happens when the aliasee is not a symbol, or when that symbol is private.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn updated this revision to Diff 31812.Aug 11 2015, 7:14 AM
john.brawn retitled this revision from to Redo "Make global aliases have symbol size equal to their type".
john.brawn updated this object.
john.brawn added reviewers: rafael, ab.
john.brawn set the repository for this revision to rL LLVM.
john.brawn added a subscriber: llvm-commits.
rafael edited edge metadata.Aug 11 2015, 8:16 AM

This also needs a negative test showing when .size is *not* printed.

It would also be nice to add a test to clang with both -emit-llvm and -S. This is one of the special situations where I think an integration test makes sense. If we change how we represent this we will still want to make sure clang is not printing extra .size directives.

Thanks!

john.brawn updated this revision to Diff 31938.Aug 12 2015, 7:09 AM
john.brawn edited edge metadata.

Make the test check that the size directive is not emitted when we expect it to not be emitted.

It would also be nice to add a test to clang with both -emit-llvm and -S. This is one of the special situations where I think an integration test makes sense. If we change how we represent this we will still want to make sure clang is not printing extra .size directives.

http://reviews.llvm.org/D11980

rafael accepted this revision.Aug 12 2015, 7:57 AM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Aug 12 2015, 7:57 AM
This revision was automatically updated to reflect the committed changes.