[PATCH] D138658: [DebugInfo] Store optional DIFile::Source as pointer

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 14:59:31 PST 2022


dblaikie added a comment.

In D138658#3967686 <https://reviews.llvm.org/D138658#3967686>, @scott.linder wrote:

> In D138658#3965822 <https://reviews.llvm.org/D138658#3965822>, @Hahnfeld wrote:
>
>>> I think we can't use `getCanonicalMDString` here, because it collapses the empty case into the null case, when they were intended to be differentiated. So this'll need to be manually expanded to the `MDString::get(Context, S)` without the empty->nullptr part. Then empty -> empty MDString, None -> null, non-empty -> non-empty MDString.
>>
>> Ok, I understood @scott.linder's comment to say that we can collapse the two cases. Maybe I got this wrong, could you clarify if we need to differentiate the two cases? If so, I'm not actually sure it makes sense to have a non-`nullptr` for the empty string, this would be a first as well, all other cases in this file are using `getCanonicalMDString`...
>
> Sorry for the confusion! I think we should retain the distinction, I only meant to say I'm OK with a different representation. That is, I am OK with using a `nullptr` to signal "No Source Available", as distinct from the empty string.

Ah, thanks for clarifying (& sorry for my delayed response that came after your reply - I end up with tabs open for far too long sometimesl


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138658/new/

https://reviews.llvm.org/D138658



More information about the llvm-commits mailing list