[PATCH] MIR Serialization: Print and parse machine function names.

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri May 22 11:19:20 PDT 2015


> On 2015 May 21, at 18:22, Justin Bogner <mail at justinbogner.com> wrote:
> 
> Alex L <arphaman at gmail.com> writes:
>> 2015-05-21 15:42 GMT-07:00 Duncan P. N. Exon Smith <dexonsmith at apple.com>:
>>> On 2015 May 21, at 15:14, Alex Lorenz <arphaman at gmail.com> wrote:
>>>> -  // Parse the block scalar manually so that we can return unique pointer
>>>> -  // without having to go trough YAML traits.
>>>> -  if (In.setCurrentDocument()) {
>>>> +std::unique_ptr<Module> MIRParserImpl::parse(SMDiagnostic &Error) {
>>>> +  yaml::Input In(SM.getMemoryBuffer(SM.getMainFileID())->getBuffer(),
>>>> +                 /*Ctxt=*/nullptr, handleYAMLDiag, &Error);
>>> 
>>> Can you clang-format this?  The comment right against the `nullptr` is
>>> awkward.
>> 
>> Clang-format leaves it likes this, should I add a space between the comment
>> and nullptr?
> 
> clang-format leaves comments-in-argument-lists like this alone - I guess
> it doesn't have an opinion. FWIW, the predominate style in the llvm repo
> is like Alex wrote it here, which no space:
> 
> llvm % git grep '/\* \?[A-Za-z]\+= \?\*/ \?' | wc -l
>     722
> llvm % git grep '/\* \?[A-Za-z]\+= \?\*/ ' | wc -l
>      54
> llvm % git grep '/\* \?[A-Za-z]\+= \?\*/[^ ]' | wc -l
>     668
> llvm % git grep '/\*[A-Za-z]\+=\*/[^ ]' | wc -l
>     663

I personally find:

    /* Ctxt */ nullptr

the most readable, and it looks like we have the most of those:
--
$ git grep '/\* \?[A-Za-z]\+ \?\*/ \?' | wc -l
     955
--

LGTM either way.



More information about the llvm-commits mailing list