This is an archive of the discontinued LLVM Phabricator instance.

[MC] Default MCContext::UseNamesOnTempLabels to false and only set it to true for MCAsmStreamer
ClosedPublic

Authored by MaskRay on Feb 24 2020, 6:12 PM.

Details

Summary

Only MCAsmStreamer (assembly output) needs to keep .Ltmp* names.

Similar to rL236642. Made the optimization available for cc1as as well.

This eliminates a behavior difference between llvm-mc -filetype=obj and cc1as, which caused
https://reviews.llvm.org/D74006#1890487

Diff Detail

Event Timeline

MaskRay created this revision.Feb 24 2020, 6:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2020, 6:12 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Does UseNamesOnTempLabels really need to be configurable? If we're going to force it to false everywhere, might as well just get rid of it.

In terms of tests, we can add cc1as tests to clang/test/Misc; just need to be marked REQUIRES: arm-registered-target or something like that.

That said, if we need to write cc1as-specific tests for anything other than the command-line parsing, probably something has gone wrong.

In terms of tests, we can add cc1as tests to clang/test/Misc; just need to be marked REQUIRES: arm-registered-target or something like that.

That said, if we need to write cc1as-specific tests for anything other than the command-line parsing, probably something has gone wrong.

Thanks.

Does UseNamesOnTempLabels really need to be configurable? If we're going to force it to false everywhere, might as well just get rid of it.

It is used by MCAsmStreamer (e.g. llvm-mc -filetype=asm; the output is also assembly).

MaskRay updated this revision to Diff 246607.Feb 25 2020, 5:27 PM
MaskRay retitled this revision from [cc1as] Unset UseNamesOnTempLabels to [MC] Default MCContext::UseNamesOnTempLabels to false and only use it for MCAsmStreamer.
MaskRay edited the summary of this revision. (Show Details)

Repurpose

Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2020, 5:27 PM
This revision is now accepted and ready to land.Feb 25 2020, 6:13 PM
MaskRay updated this revision to Diff 246616.Feb 25 2020, 6:21 PM
MaskRay retitled this revision from [MC] Default MCContext::UseNamesOnTempLabels to false and only use it for MCAsmStreamer to [MC] Default MCContext::UseNamesOnTempLabels to false and only set it to true for MCAsmStreamer.
MaskRay edited the summary of this revision. (Show Details)

Fix title

This revision was automatically updated to reflect the committed changes.