This is an archive of the discontinued LLVM Phabricator instance.

[asm] Correctly handle special names in variants
ClosedPublic

Authored by thakis on Nov 15 2021, 9:10 AM.

Details

Summary

There's really no reason why anyone should use these special names in a variant.
I noticed this while reading the code: all other writes to OS are guarded by
this conditional, and the behavior with the check seems more correct, so
let's add the check.

Diff Detail

Event Timeline

thakis created this revision.Nov 15 2021, 9:10 AM
thakis requested review of this revision.Nov 15 2021, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2021, 9:10 AM
hans added a comment.Nov 15 2021, 9:45 AM

I'm not familiar with this code, so apologies for the silly question, but how does this change make a difference for the new test case?

Without the patch, the output of the new line was bar 1 x1 since the ${:uid} in the second variant was printed despite it not being the active variant.

hans accepted this revision.Nov 15 2021, 11:45 AM

Thanks! lgtm

This revision is now accepted and ready to land.Nov 15 2021, 11:45 AM
This revision was automatically updated to reflect the committed changes.