This is an archive of the discontinued LLVM Phabricator instance.

[Bash-autocompletion] Add support for -std=
ClosedPublic

Authored by yamaguchi on Aug 16 2017, 11:55 PM.

Details

Summary

Add support for autocompleting values of -std= by including
LangStandards.def. This patch relies on D36782, and is using two-stage
code generation.

Event Timeline

yamaguchi created this revision.Aug 16 2017, 11:55 PM
ruiu added inline comments.Aug 17 2017, 8:25 AM
clang/include/clang/Driver/Options.td
2254

const char* Values -> const char *Values

2254–2258

I think Raphael suggested indenting embedded code with at least 2 spaces. I think you want to indent it with 4 spaces so that it looks better.

llvm/utils/TableGen/OptParserEmitter.cpp
314

Why do you have to change this? The previous code looks nicer.

yamaguchi updated this revision to Diff 111549.Aug 17 2017, 1:03 PM
yamaguchi marked 2 inline comments as done.

Update diff.

yamaguchi added inline comments.Aug 17 2017, 1:05 PM
llvm/utils/TableGen/OptParserEmitter.cpp
314

Because I got an error that ValuesWereAdded are defined several times.

ruiu added inline comments.Aug 17 2017, 1:09 PM
llvm/utils/TableGen/OptParserEmitter.cpp
314

Okay, but I think at least you want to move the definition into the scope that line 310 defines, so that the scope of the variable ends at the code that line 322 emits.

yamaguchi updated this revision to Diff 111611.Aug 17 2017, 9:32 PM
yamaguchi marked 3 inline comments as done.

Update diff.

ruiu added inline comments.Aug 17 2017, 9:38 PM
llvm/utils/TableGen/OptParserEmitter.cpp
309

You can flip the condition to do early continue.

319–320

Can you split the string after each "\n"? It seems the current way of splitting is somewhat arbitrary.

yamaguchi added inline comments.Aug 18 2017, 10:46 PM
llvm/utils/TableGen/OptParserEmitter.cpp
319–320

Those code are on review in D36782 and I've fixed it, so I think it's fine now :)

Update diff. Thank you for your comments!

ruiu accepted this revision.Aug 19 2017, 1:28 PM

LGTM

This revision is now accepted and ready to land.Aug 19 2017, 1:28 PM
v.g.vassilev accepted this revision.Aug 27 2017, 4:29 AM

LGTM +ping!

This revision was automatically updated to reflect the committed changes.