[llvm-dev] [cfe-dev] How to debug if LTO generate wrong code?

Rafael Espíndola via llvm-dev llvm-dev at lists.llvm.org
Mon May 30 16:56:22 PDT 2016


On 30 May 2016 at 19:55, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
>
> Sent from my iPhone
>
>> On May 30, 2016, at 4:52 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>>
>>> On 30 May 2016 at 16:56, Mehdi Amini <mehdi.amini at apple.com> wrote:
>>>
>>>
>>> On 05/30/16 01:34 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>>>
>>> We don't use cl::opt in gold, instead we parse the -plugin-opts that
>>> gold passes the plugin (see process_plugin_option).
>>>
>>> What about that:
>>>
>>> $ grep ParseCommandLineOptions tools/gold/gold-plugin.cpp
>>>
>>>      // ParseCommandLineOptions() expects argv[0] to be program name.
>>> Lazily
>>>
>>>    cl::ParseCommandLineOptions(NumOpts, &options::extra[0]);
>>
>>
>> That is for the options that the gold plugin itself doesn't understand
>> and just passes to llvm. This allows you to do things like
>> --plugin-opt=-debug-pass=Arguments.
>
> This is what I expected, so my cl:opt should work, right? I don't really get your original point?

Just that the gold plugin itself never defines a cl::opt. It just
forwards the llvm ones.

Cheers,
Rafael


More information about the llvm-dev mailing list