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

Jonas Hahnfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 00:03:47 PST 2022


Hahnfeld added a comment.

> 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`...


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

https://reviews.llvm.org/D138658



More information about the llvm-commits mailing list