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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 13:25:40 PST 2022


dblaikie added inline comments.


================
Comment at: llvm/include/llvm/IR/DebugInfoMetadata.h:619
+                   getCanonicalMDString(Context, Directory), MDChecksum,
+                   Source ? getCanonicalMDString(Context, *Source) : nullptr,
+                   Storage, ShouldCreate);
----------------
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.

And the test case can be updated to demonstrate that the difference between empty and null is preserved.


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

https://reviews.llvm.org/D138658



More information about the llvm-commits mailing list