[lld] r194492 - [MachO] Simplify conditionals. No functionality change.

Rui Ueyama ruiu at google.com
Tue Nov 12 10:23:25 PST 2013


I intentionally left the braces because of the comments. It seems alarming
if there are two lines indented to the same column after "if", as it looks
like the second line is misaligned. In this case, the first line is
comment, so it'd actually not a problem, but it would have been a bit
surprise at first sight.

On Tue, Nov 12, 2013 at 10:13 AM, Shankar Easwaran
<shankare at codeaurora.org>wrote:

> Single block if-statement is containining braces. You might want to remove
> the braces :)
>
> Does clang-format detect it and remove it ? any idea ?
>
>
> On 11/12/2013 11:46 AM, Rui Ueyama wrote:
>
>> Author: ruiu
>> Date: Tue Nov 12 11:46:55 2013
>> New Revision: 194492
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=194492&view=rev
>> Log:
>> [MachO] Simplify conditionals. No functionality change.
>>
>> Modified:
>>      lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
>>
>> Modified: lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/
>> ReaderWriter/MachO/MachOLinkingContext.cpp?rev=
>> 194492&r1=194491&r2=194492&view=diff
>> ============================================================
>> ==================
>> --- lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/MachO/MachOLinkingContext.cpp Tue Nov 12
>> 11:46:55 2013
>> @@ -221,14 +221,12 @@ bool MachOLinkingContext::validateImpl(r
>>     if ((_outputFileType == MH_EXECUTE) && _entrySymbolName.empty()){
>>       if (_outputFileTypeStatic) {
>>         _entrySymbolName = "start";
>> -    } else {
>> -      // If targeting newer OS, use _main
>> -      if (addEntryPointLoadCommand())
>> -        _entrySymbolName = "_main";
>> -
>> +    } else if (addUnixThreadLoadCommand()) {
>>         // If targeting older OS, use start (in crt1.o)
>> -      if (addUnixThreadLoadCommand())
>> -        _entrySymbolName = "start";
>> +      _entrySymbolName = "start";
>> +    } else if (addEntryPointLoadCommand()) {
>> +      // If targeting newer OS, use _main
>> +      _entrySymbolName = "_main";
>>       }
>>     }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/d87c9e13/attachment.html>


More information about the llvm-commits mailing list