This is an archive of the discontinued LLVM Phabricator instance.

Disallow using function parameters in extended asm inputs or outputs in naked functions (PR21178)
ClosedPublic

Authored by hans on Oct 6 2014, 7:55 PM.

Details

Summary

Clang won't emit any prologues for such functions, so it would assert trying to codegen the parameter references.

This patch makes Clang check the extended asm inputs and outputs for references to function parameters.

It is probably still possible to shoot oneself in the foot since other arbitrary expressions are allowed there :/

Diff Detail

Event Timeline

hans updated this revision to Diff 14487.Oct 6 2014, 7:55 PM
hans retitled this revision from to Disallow using function parameters in extended asm inputs or outputs in naked functions (PR21178).
hans updated this object.
hans edited the test plan for this revision. (Show Details)
hans added a reviewer: rnk.
hans added subscribers: Unknown Object (MLST), hansw.
majnemer added inline comments.
lib/Sema/SemaStmtAsm.cpp
91–94

Is it worth doing the recursion if we aren't inside a naked function?

hans updated this revision to Diff 14522.Oct 7 2014, 11:44 AM

Try to avoid doing work for non-naked functions.

rnk accepted this revision.Oct 7 2014, 3:38 PM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Oct 7 2014, 3:38 PM
hans closed this revision.Oct 7 2014, 7:08 PM
hans updated this revision to Diff 14546.

Closed by commit rL219272 (authored by @hans).