[llvm-commits] gold plugin: report errors occured in lto_module_create_from_*

Bill Wendling wendling at apple.com
Thu Sep 8 15:32:43 PDT 2011


Hi Krasin,

This looks okay. But could you reverse the error and ok bits?

    const char* msg = lto_get_error_message();
    if (msg) {
      (*message)(LDPL_ERROR, "Failed to create LTO module: %s", msg);
      return LDPS_ERR;
    }
    return LDPS_OK;

Or more concise:

    if (const char* msg = lto_get_error_message()) {
      (*message)(LDPL_ERROR, "Failed to create LTO module: %s", msg);
      return LDPS_ERR;
    }
    return LDPS_OK;


-bw

On Sep 8, 2011, at 1:49 PM, Ivan Krasin wrote:

> Friendly ping
> 
> On Thu, Sep 8, 2011 at 12:50 AM, Ivan Krasin <krasin at chromium.org> wrote:
>> Hi llvm team!
>> 
>> It appears that gold plugin does not check for errors occured in
>> lto_module_create_from_*. It just silently returns with LDPS_OK
>> status.
>> This patch makes it to report occurred errors (if any).
>> 
>> Is it fine to commit?
>> 
>> krasin
>> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list