[llvm] r205974 - Follow-up to r205973: change the return type to const MDNode*.

Adrian Prantl aprantl at apple.com
Thu Apr 10 11:29:05 PDT 2014


Because they store it in LiveUserVar, or in a DebugLoc, both of which take MDNodes. The more I think about it I’m actually preferring the original version that returns a DIVariable again. It’s also more descriptive and (marginally more) type safe.

-- adrian

On Apr 10, 2014, at 11:18 AM, David Blaikie <dblaikie at gmail.com> wrote:

> On Thu, Apr 10, 2014 at 11:10 AM, Adrian Prantl <aprantl at apple.com> wrote:
>> 
>> On Apr 10, 2014, at 11:04 AM, David Blaikie <dblaikie at gmail.com> wrote:
>> 
>>> On Thu, Apr 10, 2014 at 10:50 AM, Adrian Prantl <aprantl at apple.com> wrote:
>>>> Author: adrian
>>>> Date: Thu Apr 10 12:50:30 2014
>>>> New Revision: 205974
>>>> 
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=205974&view=rev
>>>> Log:
>>>> Follow-up to r205973: change the return type to const MDNode*.
>>> 
>>> It'd be helpful to explain (in the commit message, ideally) the
>>> motivation for changes like this.
>> 
>> That's right. All uses cast the result to const MDNode*, so wrapping the result in a DIVariable seems like a waste of resources (then again wrapping an MDNode in a DIVariable should be close to zero cost, but this way the helper function at least matches its uses).
> 
> Curious - why would all the callers want MDNodes instead of DIVariables?





More information about the llvm-commits mailing list