[cfe-dev] Varying per function optimisation based on include path?

Arthur O'Dwyer via cfe-dev cfe-dev at lists.llvm.org
Sun Aug 25 08:08:57 PDT 2019


On Sun, Aug 25, 2019 at 10:26 AM Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
wrote:

> On Sun, Aug 25, 2019 at 9:48 AM John McFarlane <john at mcfarlane.name>
> wrote:
>
>> On Sat, 24 Aug 2019 at 14:56, Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
>> wrote:
>>
>
> I intuit that it should be easy to "step *over*" calls to library
>>> functions; which means that you must ensure that the call to `std::find_if`
>>> shows up as a call instruction in the binary. If we inline `std::find_if`
>>> into `contains_sg15`, then you can't "step over" it anymore.
>>>
>>
>> So, are you saying that if we inline `find_if` AND we generate debugging
>> symbols, then the debugger's just going to jump us to `find_if` when we
>> step over, right?
>>
>
> No, not at all.  You're thinking of "step into."  "Step into" steps down
> into function calls. "Step over" steps *over* function calls. The
> metaphor here is that a function call is like a pothole or trapdoor down
> into the next lower level of the code. You can either step "into" the hole,
> or step "over" it.
>

Oops, strike that!
You said if we *do* inline find_if, will "step over" actually skip over the
whole inlined loop or will it act like "step into". I have no intuition
either way. I would even bet that different debuggers do different things.
(I had initially misread your sentence as "...if we *don't* inline
`find_if`...".)

–Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190825/62f1f5f9/attachment.html>


More information about the cfe-dev mailing list