This is an archive of the discontinued LLVM Phabricator instance.

Disallow an empty string literal in an asm label
ClosedPublic

Authored by aaron.ballman on Jan 7 2020, 4:08 PM.

Details

Summary

An empty string literal in an asm label does not make a whole lot of sense. GCC does not diagnose such a construct, but it also generates code that cannot be assembled by gas should two symbols have an empty asm label within the same TU. This does not affect an asm statement with an empty string literal, which is still a useful construct.

The default parameter was converted to a mandated parameter in ParseSimpleAsm() because all callers passed the argument anyway. The test code in CodeGen\asm-label.c was removed because it was no longer needed to satisfy the PR (it's covered by test code in Parser\asm.c).

Diff Detail

Event Timeline

aaron.ballman created this revision.Jan 7 2020, 4:08 PM
rjmccall accepted this revision.Jan 7 2020, 4:20 PM

LGTM

This revision is now accepted and ready to land.Jan 7 2020, 4:20 PM
aaron.ballman accepted this revision.Jan 8 2020, 5:39 AM

Accepting based on @rjmccall's LG so I can close.