[LLVMdev] LLD: Returning true on success

Shankar Easwaran shankare at codeaurora.org
Tue Sep 24 13:51:28 PDT 2013


On 9/24/2013 2:33 PM, Rui Ueyama wrote:
> Hi LLD developers,
>
> I'm about to make a change to invert the return value of 
> Driver::parse() to return true on success. Currently it returns false 
> on success.
You have to be a bit careful here, as the return from parse is used as a 
exit code from lld.

The Unix shell interprets 0 (false as success) as 1(true as failure).

It has to be consistent throughout for this reason.

As Bigcheese mentioned,  if its in the Coding standard this would really 
help.

Thanks

Shankar Easwaran
>
> In many other functions, we return true to indicate success and false 
> to indicate failure. The inconsistency is confusing, and fixing it 
> should improve code readability.
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-dev mailing list