This is an archive of the discontinued LLVM Phabricator instance.

Add extension 'gnu_asm_goto_with_outputs'
AbandonedPublic

Authored by void on Jan 23 2020, 6:01 PM.

Details

Reviewers
nickdesaulniers
Summary

Clang now supports GNU's asm goto with outputs.

Event Timeline

void created this revision.Jan 23 2020, 6:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2020, 6:01 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
void updated this revision to Diff 240657.Jan 27 2020, 12:38 PM

Use GNU asm predicate for the "asm goto with outputs" extension.

Great idea; thanks for the patch! Needs documentation. :)

clang/test/Parser/asm-goto-with-outputs.c
7 ↗(On Diff #240657)

probably don't need a bunch of test cases, just the check for the preprocessor define? In that case, why don't you just add the above to an existing asm goto test?

void updated this revision to Diff 240663.Jan 27 2020, 1:07 PM
void marked 2 inline comments as done.

Move extension test to exsiting test.

void added a comment.Jan 27 2020, 1:08 PM

Great idea; thanks for the patch! Needs documentation. :)

I can't find a place for documentation of extensions, at least not the names of extensions like gnu_asm.

clang/test/Parser/asm-goto-with-outputs.c
7 ↗(On Diff #240657)

Sure. done.

void updated this revision to Diff 240681.Jan 27 2020, 2:06 PM

Add description of "gnu_asm_goto_with_outputs" to the language extensions doc.

Great idea; thanks for the patch! Needs documentation. :)

I can't find a place for documentation of extensions, at least not the names of extensions like gnu_asm.

How about https://clang.llvm.org/docs/LanguageExtensions.html#checks-for-standard-language-features ? Then we can add both gnu_asm and gnu_asm_goto_with_outputs.

clang/test/Parser/asm-goto.c
9

ah, sorry, maybe a test that makes use of asm goto + output constraints? Maybe if you base your patch on top of the others in the series that implement the feature?

MaskRay added inline comments.
clang/docs/LanguageExtensions.rst
1273

Is the canonical spelling %l2?

void marked an inline comment as done.Jan 27 2020, 2:59 PM

Great idea; thanks for the patch! Needs documentation. :)

I can't find a place for documentation of extensions, at least not the names of extensions like gnu_asm.

How about https://clang.llvm.org/docs/LanguageExtensions.html#checks-for-standard-language-features ? Then we can add both gnu_asm and gnu_asm_goto_with_outputs.

That looks like it's features specific to various versions of C/C++. There were other examples like https://clang.llvm.org/docs/LanguageExtensions.html#blocks.

clang/test/Parser/asm-goto.c
9

There's one below in zoo. The order of these patches is a bit wonky because the front-end patch, which has more tests for AGWO, should go in before this one.

void marked an inline comment as done.Jan 27 2020, 3:03 PM
void added inline comments.
clang/docs/LanguageExtensions.rst
1273

Nice catch! I patched it in D69876.

void abandoned this revision.Jan 27 2020, 4:30 PM

I'm going to merge this into D69876 as it's closely related.